MATLAB Functions Help Desk

break

Purpose

Break out of flow control structures

Syntax

Description

break terminates the execution of for and while loops. In nested loops, break exits from the innermost loop only.

Examples

The indented statements are repeatedly executed until nonpositive n is entered.

See Also

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



[ Previous | Help Desk | Next ]