A very simple, and perhaps obvious, question: How can I abort execution of a Matlab M-script using a statement within the script?
This is analogous to calling ret
If return is not want you need, I think you want to use break
break terminates the execution of a Matlab code. For example, 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 occurs. Control passes to the statement that follows the end of that loop.