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?

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

回答(1 个)

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.

类别

帮助中心File Exchange 中查找有关 Debugging and Improving Code 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by