Debugging and Analysis

Diagnose problems, check syntax and release compatibility

As you work in the Editor, MATLAB® automatically identifies potential coding problems. Debugging features help you diagnose specific issues. Additionally, you can generate reports that help you update your code when you upgrade to a newer MATLAB release.

Functions

expand all

dbclearRemove breakpoints
dbcontResume execution
dbdownReverse dbup workspace shift
dbquitQuit debug mode
dbstackFunction call stack
dbstatusList all breakpoints
dbstepExecute next executable line from current breakpoint
dbstopSet breakpoints for debugging
dbtypeDisplay file with line numbers
dbupShift current workspace to workspace of caller in debug mode
keyboardGive control to keyboard
echoDisplay statements during function or script execution
checkcodeCheck MATLAB code files for possible problems
mlintrptRun checkcode for file or folder
codeCompatibilityReportCreate code compatibility report
analyzeCodeCompatibilityCreate code compatibility analysis results

Topics

Debugging

Debug a MATLAB Program

To debug your MATLAB program graphically, use the Editor/Debugger. Alternatively, you can use debugging functions in the Command Window.

Add Reminders to Files

Annotating a file makes it easier to find areas of your code that you intend to improve, complete, or update later.

Editor/Debugger Preferences

Use Editor/Debugger preferences to customize the Editor.

Syntax Checking

Check Syntax as You Type

Some entries appear in different colors in the Command Window, the Editor, and the Live Editor to help you identify MATLAB elements. This is known as syntax highlighting.

Check Code for Errors and Warnings

Use the MATLAB Code Analyzer to check your code for coding problems automatically.

MATLAB Code Analyzer Report

Generate a report that identifies potential errors, problems, and opportunities for improvement in your code.

Code Analyzer Preferences

Set Code Analyzer preferences to enable or disable Code Analyzer features and specify message indicator preferences.

Release Compatibility

MATLAB Code Compatibility Report

Generate a report to identify potential compatibility issues in your code when you upgrade to a newer MATLAB release.