views:

187

answers:

2

I have a pretty simple question: how can I terminate a running script in matlab using code, similar to using CTRL + C?

I want the program to stop running if a user enters incorrect digits.

+5  A: 

Use the error function. See doc error for more information.

kwatford
Thank you for replying :)
ZaZu
+3  A: 

If in debug mode, you can use dbquit. if you're in the main function, return terminates and returns. Otherwise use the error function.

Donnie
Thank you, return did the trick !
ZaZu

related questions