Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Breakpoint strange behaviour

Subject: Breakpoint strange behaviour

From: Gianluca

Date: 12 Jul, 2013 19:58:20

Message: 1 of 3

Hi,

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.
Any idea about this problem? I don't know what to do....

P.S. I am using Matlab R2011a

Thanks

Gianluca

Subject: Breakpoint strange behaviour

From: Jan Simon

Date: 12 Jul, 2013 21:59:08

Message: 2 of 3

Dear Gianluca,

I guess, that other times like "t==3" are not reached exactly during the integration.
So perhaps you need a condition like "t>=3".

You could add something like this to check, if the effect concerns the breakpoints only:
  if t == 3, disp('3 reached'); end

Kind regards, Jan

Subject: Breakpoint strange behaviour

From: Gianluca

Date: 13 Jul, 2013 09:41:13

Message: 3 of 3

"Jan Simon" wrote in message <krpu7c$pa2$1@newscl01ah.mathworks.com>...
> Dear Gianluca,
>
> I guess, that other times like "t==3" are not reached exactly during the integration.
> So perhaps you need a condition like "t>=3".
>
> You could add something like this to check, if the effect concerns the breakpoints only:
> if t == 3, disp('3 reached'); end
>
> Kind regards, Jan


Thanks a lot! You were right, I used the condition t>=.... and it worked perfectly.

Gianluca

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us