From: samah karim on
I want to stop a running program but not exit MATLAB. I have doubly netsed loops and the break will only get me out of one of them. I want to get out of both. Please help.
From: David Young on
One way:

Set a flag in the inner loop just before the break.

Test the flag in the outer loop and break from that as well if the flag is set.

Alternatively:

Use "return" in the inner loop instead of break.