Development Environment |
Running an M-File with Breakpoints
After setting breakpoints, run the M-file from the Command Window or the Editor/Debugger.
For the example, run collatzplot
for the simple input value, 3, by typing in the Command Window
The example, collatzplot
, requires an input argument and therefore runs only from the Command Window and not from the Editor/Debugger.
Results of Running an M-File Containing Breakpoints. Running the M-file results in the following:
collatzplot
. This means that line 10 will be executed when you continue. The pause is indicated in the Editor/Debugger by the green arrow just to the right of the breakpoint as shown here.
dbstack
to view the current call stack.
While in debug mode, you can set breakpoints, step through programs, examine variables, and run other functions.
Setting Breakpoints | Stepping Through an M-File |