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:
how make conditional breakpoint written inside code

Subject: how make conditional breakpoint written inside code

From: besbesmany besbesmany

Date: 11 Jan, 2012 13:43:08

Message: 1 of 5

i want to make breakpoint by using dbstop
when this occures
ismember(1,isnan(A(1:m,:)))
where A is matrix

how to make this ??

i want to put this code inside the code and not making it by the yellow breakpoint where i put this code each time i run the code by right click on line and choose conditional breakpoint
because it is not saved and each run i've to make it from begining

i tried this code but it failed

dbstop in file1 if ismember(1,isnan(A(1:m,:)))
where file1 is my .m file that have code in function

Subject: how make conditional breakpoint written inside code

From: besbesmany besbesmany

Date: 11 Jan, 2012 13:57:08

Message: 2 of 5

also how can i clear these condtional breakpoint inside the code by dbclear

"besbesmany besbesmany" <besbesmany@yahoo.com> wrote in message <jek3lb$brg$1@newscl01ah.mathworks.com>...
> i want to make breakpoint by using dbstop
> when this occures
> ismember(1,isnan(A(1:m,:)))
> where A is matrix
>
> how to make this ??
>
> i want to put this code inside the code and not making it by the yellow breakpoint where i put this code each time i run the code by right click on line and choose conditional breakpoint
> because it is not saved and each run i've to make it from begining
>
> i tried this code but it failed
>
> dbstop in file1 if ismember(1,isnan(A(1:m,:)))
> where file1 is my .m file that have code in function

Subject: how make conditional breakpoint written inside code

From: besbesmany besbesmany

Date: 12 Jan, 2012 12:07:08

Message: 3 of 5

any Help please

Subject: how make conditional breakpoint written inside code

From: Bruno Luong

Date: 12 Jan, 2012 14:14:08

Message: 4 of 5

"besbesmany besbesmany" <besbesmany@yahoo.com> wrote in message <jemidc$jgm$1@newscl01ah.mathworks.com>...
> any Help please

1st option: put the 'keyboard' inside the test
2nd option: put error('dummy breakpoint') inside the test and triggle it with 'dbstop if error' on command line.

and there are perhaps many other ways.

Bruno

Subject: how make conditional breakpoint written inside code

From: Matt J

Date: 12 Jan, 2012 15:39:08

Message: 5 of 5

"besbesmany besbesmany" <besbesmany@yahoo.com> wrote in message <jek3lb$brg$1@newscl01ah.mathworks.com>...
>
>
> ismember(1,isnan(A(1:m,:)))
================

A much more efficient test expression would be

any(isnan(A(1:m,:)))



> i tried this code but it failed
>
> dbstop in file1 if ismember(1,isnan(A(1:m,:)))
> where file1 is my .m file that have code in function
==============

Elaborate on "it failed". You mean you know for sure that there were nans in
A(1:m,:) and yet the debugger didn't stop?

Tags for this Thread

No tags are associated with 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