MATLAB Answers

return to previous step

25 views (last 30 days)
arwa
arwa on 21 Dec 2016
Answered: James Tursa on 21 Dec 2016
hello, I have a program code including some steps like step A,B,C and D I want at step D if condition is true go back or return to step B and so on. How can I translate it? Can I use while loop?

  0 Comments

Sign in to comment.

Accepted Answer

James Tursa
James Tursa on 21 Dec 2016
Do you mean something like this?
% Step A
while( true )
% Step B
% Step C
% Step D
if( condition )
continue % <-- return to Step B
end
% Step E
break % <-- go to Step F
end
% Step F
Without more details about your code, it is hard to know what logic you really need.

  0 Comments

Sign in to comment.

More Answers (0)

Sign in to answer this question.

Tags