MATLAB The Break Statement - MATLAB

What is MATLAB The 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 happens. control passes to the statement following the end of that loop.

Flow Diagram

MATLAB - The break Statement


Example

Create a script file and type the following code:

When you run the file, it displays the following result:

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

MATLAB Topics