stop for loop if a thing happens
Mostrar comentarios más antiguos
for example:
for i=1:10
a=i+1
if a>5
exit from loop % *which command do this*
end
end
Respuesta aceptada
Más respuestas (2)
Wesley Ooms
el 8 de Sept. de 2011
0 votos
the command is 'return' i guess
Wesley Ooms
el 8 de Sept. de 2011
0 votos
i looked it up for you. the command is 'break' :)
2 comentarios
Oleg Komarov
el 8 de Sept. de 2011
@Weasley: please edit your answers in place of creating new ones.
feras almasri
el 4 de Abr. de 2015
plz answer him instead of saying this
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!