How to Stop an M File?
28 views (last 30 days)
Show older comments
Mahmoud Rashidi on 10 Mar 2017
Answered: John Chilleri on 10 Mar 2017
I have several functions in an M File:
How can I stop executing a specific function and exit the script?
You can use return in your script and function to exit.
function output = blah(input)
if input == 5
output = 1;
With a script:
output = blah(input)
if output == 1
So in summary, you can use return just as you might in a function.
Hope this helps!
More Answers (0)
Find more on Search Path in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!