Specifying a callback in Matlab after any runtime error

后端 未结 3 794
悲哀的现实
悲哀的现实 2020-12-10 18:55

Is there a way to specify code to be run whenever an error occurs in Matlab? Googling I came across RunTimeErrorFcn and daqcallback, but I believe these are specific to the

3条回答
  •  佛祖请我去吃肉
    2020-12-10 19:34

    One trick is to use Error Breakpoints by issuing the command:

    dbstop if error
    

    which when enabled, causes MATLAB to enter debug mode at the point of error. You can access the same functionality from the Debug menu on the main toolbar.

    breakpoints_dialog

提交回复
热议问题