I cannot get the continue command to work in for-loops. For instance, with the code:
q(1) = 1;q(2) = 2;q(3) = 3;q(4) = 4;q(5) = 5;for j=1:5 if j==2 continue end qv=qend
I expected the outcome of executing this code to be qv = [1 3 4 5], however the actual outcome is qv = [1 2 3 4 5].
Any suggestions as to how to get "continue" to work in this for-loop so that the output qv = [1 3 4 5] results?
Best Answer