How does 'break' work?
Ältere Kommentare anzeigen
Hi, I need to know what happens after "break"? what does the loop skip to? I need it to skip to "for i = 1:50" and start from a new i. Please help me.
for i = 1:50
if a {i,5}(1) <= a{1,4}(1)
b{i,1} = a{1,1};
else
for j = 1:50
if a {i,5}(1) >= a{j,4}(1) && a{i,5}(1) <= a{j+1,4}(1)
b{i,1} = a{j+1,1};
break
end
end
end
end
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 27 Okt. 2016
0 Stimmen
"break" lets some of the Magic Smoke out of your loop. It is sort of like letting some of the air out of your tires -- while you are driving on the highway!
1 Kommentar
Sherwin
am 27 Okt. 2016
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!