How can I disable all the breakpoints that have been set in a MATLAB code file in MATLAB 7.6(R2008a) ?

11 visualizzazioni (ultimi 30 giorni)
I want to disable all the breakpoints in a MATLAB code file, from the command prompt. I do not want to right click on each break point and select the "Disable Breakpoint" option.

Risposta accettata

MathWorks Support Team
MathWorks Support Team il 27 Gen 2010
To disable all the break points in a MATLAB code file, you need to set the expression property of the breakpoints on all lines to 'false'. The following code disables all the breakpoints in the same file.
s = dbstatus
s.expression(:) = {'false'}
dbstop(s)
The structure 's' contains the line numbers of all the breakpoints, with the corresponding expression values of these break points.
  1 Commento
Adam Danz
Adam Danz il 23 Apr 2025
Note that this will disable conditional break points but it will also conver them to a simple break point that, when re-enabled, will no longer be conditional.
To disable a conditional break point without eliminating the condition, replace the expression with "false&&(__)" where the "__" contains the original condition.
For example, let's say the conditional breakpoint is "n>0.5". s.Expressions will be {'n>0.5'}. To disable that without eliminating the condition, replace it with {'false&&(n>0.5)'}.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Debugging and Analysis in Help Center e File Exchange

Prodotti


Release

R2008a

Community Treasure Hunt

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

Start Hunting!

Translated by