Installation guide

6 Editing and Debugging M-Files
choose Evaluate Selection from the context menu. You can also use cell
mode to do this.
Conditional Breakpoints
Set conditional breakpoints to cause MATLAB to stop at a specified line in a
file only when the specified condition is met. One particularly good use for
conditional breakpoints is when you want to examine results after a certain
number of iterations in a loop. For example, se t a breakpoint at line 10 in
collatzplot, specifying that MATLAB should stop only if N is greater than or
equal to
2. T his section covers the following topics:
“Setting Conditional Breakpoints” on page 6-126
“Copying, Modifying, Disabling, and Clearing Conditional B reakpoints” on
page 6-128
“Function Alternative for Conditional Breakpoints” on page 6-128
Setting Conditional Breakpoints
To set a con d itional breakpoint, follow these steps:
1 Click in the line where you want to set the conditional breakpoint. Then
select Set/Modify Conditional Breakpoint from the Debug or context
menu. If a standard breakpoint a lready exists at that line, use this same
method to make it conditional.
6-126