http://www.mathworks.com/matlabcentral/newsreader/view_thread/330562
MATLAB Central Newsreader  Breakpoint strange behaviour
Feed for thread: Breakpoint strange behaviour
enus
©19942014 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
http://www.mathworks.com/images/membrane_icon.gif

Fri, 12 Jul 2013 19:58:20 +0000
Breakpoint strange behaviour
http://www.mathworks.com/matlabcentral/newsreader/view_thread/330562#908082
Gianluca
Hi,<br>
<br>
I am doing some debugging to a code that I made, but something strange happens when I use conditional breakpoints. In particular, I am integrating some equations with ODE45. The equations are written in a function, while ODE45 is called on a separate script. Basically, all I want to do is to stop the integration at a certain time t, in order to check the values of some variables. So I put a conditional breakpoint inside the function. The breakpoint only works in two cases (t==1 and t==2) and the integration is effectively stopped at those times. If I put any other value of time the breakpoint is totally ignored and the integration is not stopped. <br>
Any idea about this problem? I don't know what to do.... <br>
<br>
P.S. I am using Matlab R2011a<br>
<br>
Thanks <br>
<br>
Gianluca

Fri, 12 Jul 2013 21:59:08 +0000
Re: Breakpoint strange behaviour
http://www.mathworks.com/matlabcentral/newsreader/view_thread/330562#908088
Jan Simon
Dear Gianluca,<br>
<br>
I guess, that other times like "t==3" are not reached exactly during the integration. <br>
So perhaps you need a condition like "t>=3".<br>
<br>
You could add something like this to check, if the effect concerns the breakpoints only:<br>
if t == 3, disp('3 reached'); end<br>
<br>
Kind regards, Jan

Sat, 13 Jul 2013 09:41:13 +0000
Re: Breakpoint strange behaviour
http://www.mathworks.com/matlabcentral/newsreader/view_thread/330562#908096
Gianluca
"Jan Simon" wrote in message <krpu7c$pa2$1@newscl01ah.mathworks.com>...<br>
> Dear Gianluca,<br>
> <br>
> I guess, that other times like "t==3" are not reached exactly during the integration. <br>
> So perhaps you need a condition like "t>=3".<br>
> <br>
> You could add something like this to check, if the effect concerns the breakpoints only:<br>
> if t == 3, disp('3 reached'); end<br>
> <br>
> Kind regards, Jan<br>
<br>
<br>
Thanks a lot! You were right, I used the condition t>=.... and it worked perfectly.<br>
<br>
Gianluca