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에 대해 자세히 알아보기

태그

질문:

2013년 11월 4일

답변:

2013년 11월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by