How to finish work in Matlab?

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

I want the program to stop working if the user enters the wrong numbers.

+3
source share
2 answers

If in debug mode you can use dbquit. if you are in the main function, returnterminates and returns. Otherwise, use the function error.

+5
source

Use the function error. See doc errorfor more information.

+5
source

Source: https://habr.com/ru/post/1746498/


All Articles