Desktop Tools and Development Environment |
Running an M-File with Breakpoints
After setting breakpoints, run the M-file from the Command Window or the Editor/Debugger.
Running the Example
For the example, run collatzplot
for the simple input value, 3, by typing in the Command Window
collatzplot(3)
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
as shown here.
If you use debugging functions from the Command Window, the line at which you are paused is displayed in the Command Window. For the example, it would show
dbstack
to view the current call stack.
In debug mode, you can set breakpoints, step through programs, examine variables, and run other functions.
Setting Standard Breakpoints | Stepping Through an M-File |
© 1994-2005 The MathWorks, Inc.