MATLAB debugging code always encountered a strange problem, that is, when I in the main program (. m script) call the child function and set a breakpoint in the child function, and then start debugging run the main program ...
It is found that the main program runs directly to the end and does not stop at the breakpoint set when the child function is called, and the breakpoint set is cleared ...
However, if you set a breakpoint where the corresponding child function is called in the main program, stop at this point while debugging and then continue running, you can stop at the breakpoint in the child function ...
This problem has been bothering me for a long time, although the second method can achieve the required debugging functions, but always in the main program to stop, a little trouble
So, something to ask Google ~~you get the answer ...
The original is because in the main program in the beginning of the habit of calling clear all cleared, and this statement will set the breakpoint also clear out, so there will be that situation ~ ~
Khan ~ ~ ~, so, suddenly a kind of clairvoyant bright
So it's OK Google is still helpful ^ ^
Ref
https://www.mathworks.com/matlabcentral/newsreader/view_thread/258878
Http://stackoverflow.com/questions/23843708/matlab-setting-breakpoints-in-called-functions
Sub-function breakpoints do not work when MATLAB debugging