How to stop execution of mat-lab program

Apr 2010
23
0
How can i stop the execution of a mat-lab program when a certain condition is met

Code:
if x>0 
% stop execution
end
 

CaptainBlack

MHF Hall of Fame
Nov 2005
14,972
5,271
someplace
How can i stop the execution of a mat-lab program when a certain condition is met

Code:
if x>0 
% stop execution
end
break will get you out of the current loop, or if you are in a function return will exit the function (should also work in a script file).

CB