break
Programming
Exit the innermost for or while loop immediately. Execution continues with the statement after the loop end.
Syntax
break
Examples
for i = 1:100
if i > 5
break
end
disp(i)
end▶ RunSee Also
Try SimLab — Free MATLAB® Alternative
466 functions. Runs in your browser. No install.
Open SimLab