stop for loop if a thing happens
Mostra commenti meno recenti
for example:
for i=1:10
a=i+1
if a>5
exit from loop % *which command do this*
end
end
Risposta accettata
Più risposte (2)
Wesley Ooms
il 8 Set 2011
0 voti
the command is 'return' i guess
Wesley Ooms
il 8 Set 2011
0 voti
i looked it up for you. the command is 'break' :)
2 Commenti
Oleg Komarov
il 8 Set 2011
@Weasley: please edit your answers in place of creating new ones.
feras almasri
il 4 Apr 2015
plz answer him instead of saying this
Categorie
Scopri di più su Loops and Conditional Statements in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!