How do you exit a MATLAB function with an if statement?

  • Context: MATLAB 
  • Thread starter Thread starter MaxManus
  • Start date Start date
  • Tags Tags
    Function Matlab
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 48K views
MaxManus
Messages
268
Reaction score
1
How do you tell MATLAB to exit a function with an if test in matlab?
I have tried
if x > 0
exit/quit
,but I don't want to exit MATLAB only the function
 
Physics news on Phys.org
try "return" to exit the function - hopefully that is what you are looking for.