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.
If in debug mode, you can use dbquit
. if you're in the main function, return
terminates and returns. Otherwise use the error
function.
Use the error
function. See doc error
for more information.
精彩评论