调试和分析
诊断问题、检查语法及版本兼容性
在编辑器和实时编辑器中工作时,MATLAB® 自动识别潜在的编码问题。调试功能帮助您诊断特定问题。此外,您还可以生成报告,以帮助您在升级到更新的 MATLAB 版本时更新代码。
函数
主题
调试
- 调试 MATLAB 代码文件
使用不同调试方法诊断 MATLAB 代码文件中的问题。 (自 R2021b 起)
- Editor/Debugger Settings
Use Editor/Debugger settings to customize the Editor.
语法检查
- Check Syntax and Autocomplete Code as You Type
Use syntax highlighting, delimiter matching, and code suggestions to write commands faster and avoid syntax errors. - 使用代码分析器检查代码中的错误和警告
使用 MATLAB 代码分析器可自动检查您的代码有无编码问题。 - MATLAB 代码分析器报告
生成用于标识代码中的潜在错误、问题以及改进机会的报告。 - Code Analyzer Settings
Modify Code Analyzer settings to enable or disable Code Analyzer features and specify message indicator settings. - Configure Code Analyzer
Configure Code Analyzer messages and add custom checks. - Index of Code Analyzer Checks
This topic contains a listing of built-in MATLAB Code Analyzer checks which you can modify to meet your own custom coding standards.
版本兼容性
- MATLAB 代码兼容性分析器
当您升级到较新版本的 MATLAB 时,可以生成一份报告来确定您代码中潜在的兼容性问题。
代码生成
- Code Generation Readiness Tool
The code generation readiness tool screens MATLAB code for features and functions that code generation does not support.