Development Environment    

Debugging M-Files

This section introduces general techniques for finding errors, and then illustrates MATLAB debugger features found in the Editor/Debugger and debugging functions using a simple example. It includes these topics:

Types of Errors

Debugging is the process by which you isolate and fix problems with your code. Debugging helps to correct two kinds of errors:

Finding Errors

Usually, it's easy to find syntax errors based on MATLAB's error messages. Run-time errors are more difficult to track down because the function's local workspace is lost when the error forces a return to the MATLAB base workspace. Use the following techniques to isolate the cause of run-time errors:

The remainder of this section on debugging M-files describes the use of the Editor/Debugger and debugging function using an example.


 Closing M-Files Debugging Example - The Collatz Problem