| 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 file is automatically saved before it runs.
- Add the file(s) to a directory on the search path or be sure it is in the current directory - Be sure the file you run and any files it calls are in directories that are on the search path. If all files to be used are in the same directory, you can instead make that directory be the current directory.
| Trial Run for Example | | Setting Breakpoints |  |