break
The break keyword immediately terminates a for or while loop.
for j = 1:10
disp(j)
if j == 3
break
end
end
Results in:
1
2
3
The break keyword immediately terminates a for or while loop.
for j = 1:10
disp(j)
if j == 3
break
end
end
1
2
3