Presentation MatlabModified
Presentation MatlabModified
1. Break Statement
◦ The break statement terminates execution of for or while
loop. Statements in the loop that appear after the break
statement are not executed.
◦ In nested loops, break exits only from the loop in which it
occurs. Control passes to the statement following the end of
that loop.
2. Continue Statement
◦ The continue statement is
used for passing control to
next iteration of for or
while loop.
◦ The continue statement in
MATLAB works
somewhat like the break
statement. Instead of
forcing termination,
however, 'continue' forces
the next iteration of the
loop to take place,
skipping any code in
between.