| MATLAB Functions | Help Desk |
break
Break out of flow control structures
break
break
terminates the execution of for and while loops. In nested loops, break exits from the innermost loop only.
The indented statements are repeatedly executed until nonpositive n is entered.
while 1
n = input('Enter n. n <= 0 quits. n = ')
if n <= 0,break,end
r = rank(magic(n))
end
disp('That''s all.')
end Terminate for, while, and if statements and indicate
the last index
error Display error messages
for Repeat statements a specific number of times
if Conditionally execute statements
return Return to the invoking function
switch Switch among several cases based on expression
while Repeat statements an indefinite number of times