How can I disable all the breakpoints that have been set in a MATLAB code file in MATLAB 7.6(R2008a) ?
9 views (last 30 days)
Show older comments
MathWorks Support Team
on 27 Jan 2010
Commented: Adam Danz
on 23 Apr 2025
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.
Accepted Answer
MathWorks Support Team
on 27 Jan 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 Comment
Adam Danz
on 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)'}.
More Answers (0)
See Also
Categories
Find more on Debugging and Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!