Development Environment |
 |
Using Debugging Features
You can debug the M-files using the Editor/Debugger and debugging functions. You can use both methods interchangeably. The example describes both methods.
The debugging process consists of:
Preparing for Debugging
Do the following to prepare for debugging:
- Open the file - To use the Editor/Debugger for debugging, open it with the file you will run, in this example,
collatzplot.m
.
- Save changes - If you are editing the file, save the changes before you begin debugging. If you try to run and debug a file with unsaved changes, the results may be unreliable.
- Add the file(s) to the search path - Whether you use the Editor/Debugger or debugging functions, be sure the file you run and any files it calls are on the search path. If all files to be used are in the same folder, you can instead make that folder be the current directory.
| Trial Run for Example | | Setting Breakpoints |  |