debugging a callback function
Show older comments
Hi, I am trying to produce a code that plots certain information in a gui figure so that the user can make a decision, based on the plot, which function to execute next. The functions are executed by buttons on the gui figure. As the functions are triggered by callbacks if I try to debug as normal I am not able to access the function. How can I get into the function to find my error?
Thanks
Accepted Answer
More Answers (2)
KAE
on 8 Jun 2017
0 votes
Julian Dönges
on 27 Oct 2021
0 votes
Breakpoints in callbacks work only if you also set a breakpoint in the caller function/script. So, you could add a line of pause(0.1); to the caller function/script and set a breakpoint there. When the caller is stopped at that breakpoint, the breakpoint inside the callback will work as well.
Categories
Find more on Debugging and Analysis in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!