MATLAB Answers

Debug stack on error

6 views (last 30 days)
Alexandra on 28 Aug 2020
Commented: Alexandra on 3 Sep 2020
Dear all,
since I use the newer version of Matlab, I habe a problem with the debug mode. Whenever I use dbstop if error, the debugger stops miles deep in some Matlab functions and not at the position of the error. Even if I try to step through the call stack, I only step though a lot of Matlab functionality until I end up outside of debug mode.
Why is this happening? I really loved to use dbstop if error and now it is useless to me.
Best regards
Alexandra on 3 Sep 2020
Usually, I set a breakpoint on the line (as suggested), but if the error doesn't occur very often, I used to do "dbstop if error". But using a try and catch block around the section works well, too. Thank you for all the suggestions :-)

Sign in to comment.

Answers (0)


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!