Borrar filtros
Borrar filtros

return to previous step

2 visualizaciones (últimos 30 días)
arwa
arwa el 21 de Dic. de 2016
Respondida: James Tursa el 21 de Dic. de 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?

Respuesta aceptada

James Tursa
James Tursa el 21 de Dic. de 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.

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by