How can i debug a user defined function, when called in main program? i'm not able stop the execution when in the function to verify the data/work space?

1 view (last 30 days)
Actually, i have written a function for a specific task. This function i'm calling in a main program as and when required. Now, when i execute it, there is an error message pertaining to this function. Now i'm not able to break(with a break point) the execution when in the function. How can i debug in such situations? Please any one know the solution for this, Let me know. Thank you Ravi

Answers (1)

Sean de Wolski
Sean de Wolski on 4 Nov 2013
Do you have a clear all in your script that's clearing out the breakpoints? If so, remove the "all" from clear all.
Personally, I highly recommend using:
dbstop if error
Then run your code and when the error occurs it will stop and let you inspect what's going on.

Categories

Find more on Debugging and Analysis in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!