How does 'break' work?
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (1)
Walter Roberson
el 27 de Oct. de 2016
0 votos
"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 comentario
Sherwin
el 27 de Oct. de 2016
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!