continue
Pass control to next iteration of for or while loop
Syntax
Description
continue passes control to the next iteration
of a for or while loop.
It skips any remaining statements in the body of the loop for the
current iteration. The program continues execution from the next iteration.
continue applies only to the body of the
loop where it is called. In nested loops, continue skips
remaining statements only in the body of the loop in which it occurs.
Examples
Tips
The
continuestatement skips the rest of the instructions in afororwhileloop and begins the next iteration. To exit the loop completely, use abreakstatement.continueis not defined outside afororwhileloop. To exit a function, usereturn.
Extended Capabilities
Version History
Introduced before R2006a