代码注释
配置代码生成器如何将注释插入到生成的代码中
为了提高生成代码的可读性和可追溯性,您可以指定某些模型配置参数以在生成代码中插入注释。然后,代码生成器会在生成代码注释中包含模型参数、模块名称、信号名称、状态、函数和 Stateflow 对象名称的文本。要从生成代码追溯到 Simulink® 模型中的元素,请点击注释中的超链接。
主题
- Configure Code Comments
Configure how code generator inserts comments into generated code.
- Add Custom Comments for Variables in the Generated Code
Add selected data object property values as a comment in the general code above that data object identifier.
- Add Global Comments in the Generated Code
Add global comments to a Simulink model so that the comment text appears where you specify in the generated files.
- Annotate Code for Justifying Polyspace Checks
This example shows how to turn on comments in the generated code that suppress error detection through Polyspace®.
- Include MATLAB Code as Comments in Generated Code
Correlate code generated for a MATLAB Function block with MATLAB® source code.