Code Compatibility Analyzer
Identify and address compatibility issues against current version of MATLAB
Since R2022a
Description
The Code Compatibility Analyzer app generates a report of syntax errors, code incompatibilities, and new functionalities that might improve the code in a selected folder and its subfolders.
Using this app, you can:
Identify compatibility issues.
Follow suggested actions to improve code.
Open the Code Compatibility Analyzer App
MATLAB® Toolstrip: On the Apps tab, under MATLAB, click the app icon:
.
MATLAB command prompt: Enter
codeCompatibilityAnalyzer
Examples
Analyze Code Compatibility
Open the Code Compatibility Analyzer.
codeCompatibilityAnalyzer
This command opens a prompt to select a folder. Select the folder to analyze.
The Code Compatibility Analyzer generates information to help you upgrade your code to the latest version of MATLAB. It contains these sections.
Syntax errors — Table with details about syntax errors. Syntax errors result in nonrunnable code, and while they are not introduced with a new version of MATLAB, syntax errors impact compatibility analysis.
Report Column Description Occurrences Total number of syntax errors in file Filename Name of file that contains syntax errors Functionality that has been removed — Table with details about functionality used in the analyzed code that has been removed. For example, 'wavfinfo' has been removed. Use 'audioinfo' instead.
Report Column Description Description
Description of check with suggested action
Documentation
Link to more information in documentation
Removed In Release in which the functionality was removed Filename Name of file that contains flagged check Line Line number indicating location in file of flagged check. Functionality that has changed behavior — Table with details about functionality used in the analyzed code that has changed behavior. For example, 'legend' has changed and might interpret the name of an argument as a legend property instead of a label. To include a label with the same name as a legend property, specify the labels using a cell array or string array. Refer to the documentation for a list of affected property names.
Report Column Description Description
Description of check with suggested action
Documentation
Link to more information in documentation
Affects Code Written Before Release in which the functionality was changed Filename Name of file that contains flagged check Line Line number indicating location in file of flagged check Unsupported functionality that might cause errors — Table with details about functionality that is unsupported, undocumented, and not intended for use. Update your code to use documented functionality because unsupported functionality can cause errors and unexpected behavior changes. For example, 'awtinvoke' is unsupported and might have been changed or removed without notice. With appropriate code changes, use javaMethodEDT instead.
The table includes this information.
Report Column Description Description
Description of check with suggested action
Documentation
Link to more information in documentation
Filename Name of file that contains flagged check Line Line number indicating location in file of flagged check Functionality that will be removed — Table with details about functionality used in the analyzed code that will be removed in a future release. For example, 'aviinfo' will be removed in a future release. Use 'VideoReader' instead.
Report Column Description Description
Description of check with suggested action
Documentation
Link to more information in documentation
Filename Name of file that contains flagged check Line Line number indicating location in file of flagged check Functionality that will change behavior — Table with details about functionality in the analyzed code that will change behavior in a future release. For example, 'interp1(...,'cubic')' will change in a future release to perform cubic convolution. To continue using shape-preserving piecewise cubic interpolation, use 'interp1(...,'pchip')' instead.
The table includes the same columns as the Functionality that will be removed section.
New functionality that might improve code — Table with details about new functionality. Consider updating your code. Current code is expected to continue working in future releases, but newer functionality is recommended. For example, Programmatic use of DISPLAY is not recommended. Use DISP or FPRINTF instead.
Report Column Description Description
Description of check with suggested action
Documentation
Link to more information in documentation
Filename Name of file that contains flagged check Line Line number indicating location in file of flagged check Suppression Whether and how this check is suppressed in the Editor. A value of None indicates that the check is not suppressed Full list of checks performed — Table with details about the checks performed on the specified code.
Report Column Description Occurrences
In analyzed code, total number of occurrences of flagged checks
Files
In analyzed code, number of files
Description
Description of check with suggested action. For example, Use a newline, semicolon, or comma before this statement or STRMATCH is not recommended. Use STRNCMP or VALIDATESTRING instead.
Severity
Severity of check. For example,
Error
orWarning
. Errors can indicate syntax errors or use of functionality that is no longer supported. Warnings can indicate opportunities to improve your code.Identifier
Identifier for MATLAB code analyzer messages.
Documentation
Link to more information in documentation.
Full list of files analyzed — List of files that the app analyzed for code compatibility.
Related Examples
Version History
Introduced in R2022a
See Also
Functions
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)