Getting Started Previous page   Next Page

break

The break statement lets you exit early from a for loop or while loop. In nested loops, break exits from the innermost loop only.

Here is an improvement on the example from the previous section. Why is this use of break a good idea?


Previous page  continue try - catch Next page

© 1994-2005 The MathWorks, Inc.