MATLAB: How to run a code only up to a certain line

breakexitquitreturn

I'm in the process of editing an m-file that is pretty lengthy. Instead of running the whole thing, I'd like to run only the first several lines while I make some tweaks.
Is there are a MATLAB equivalent to "exit" in Stata: basically getting MATLAB to run the m-file only up to a specific line in the code?
Thanks in advance for your help.

Best Answer

Either set a breakpoint there (click on the - on the left margin) or put a return statement there.
return; % Exit script or return to calling routine.