Jump command in MATLAB

goto, matlab

Solution

There is no `goto` statement in MATLAB, but there are a few other commands for use with loops that may help you:

- `continue`: This statement will skip the remaining commands in a for or while loop and move on to the next iteration.

- `break`: This statement will terminate execution of a for or while loop.

Problem

I'm working with the m-file editor of MATLAB and I need to jump from one line to another. If I need to jump from inside a `For`...`end`, I can't use the usual "while" technique. Is there anyway to jump from a line to another, like `goto` in C?

Original source