Model Configuration Parameters: Comments - MATLAB & Simulink (original) (raw)

Main Content

The > category includes parameters for configuring the comments in the generated code. These parameters require a Simulink® Coder™ license. Additional parameters available with an ERT-based target require an Embedded Coder® license.

Code Comments are generated automatically or you can add them to the code.

Code comments have the following uses:

Code Comments can be classified into Auto generated and Custom comments. Auto generated comments are automatically generated by the software during code generation and the user adds Custom comments.

On the Configuration Parameters dialog box, the following configuration parameters are on the > pane.

Auto generated comments

Custom comments

Parameter Description
Simulink block descriptions (Embedded Coder) Specify whether to insert descriptions of blocks into generated code as comments.
Stateflow object descriptions (Embedded Coder) Specify whether to insert descriptions of Stateflow objects into generated code as comments.
Simulink data object descriptions (Embedded Coder) Specify whether to insert descriptions of Simulink data objects into generated code as comments.
Requirements in block comments (Embedded Coder) Specify whether to include requirement descriptions assigned to Simulink blocks in generated code as comments.
Connected annotations in block comments (Embedded Coder) Specify whether to include connected annotations of blocks into generated code as comments.
Custom comments (MPT objects only) (Embedded Coder) Specify whether to include custom comments for module packaging tool (MPT) signal and parameter data objects in generated code.
MATLAB user comments (Embedded Coder) Specify whether to include MATLAB user comments as comments.
Custom comments function (Embedded Coder) Specify a file that contains comments to be included in generated code for module packing tool (MPT) signal and parameter data objects.

The following configuration parameters are under the Advanced parameters.

Parameter Description
Comment style (Embedded Coder) Specify a multi-line or single-line comment style for generated C or C++ code.
Insert Polyspace comments (Embedded Coder) Specify whether to insert code comments for Polyspace block annotations.

};
When the constant value is 200 and the output data type is double, the code generator adds Expression as a comment. Simulink interprets the data type of the constant value as double and without type conversion it matches the output data type.
When the constant value is uint8(200) and the output data type is double, the code generator adds Computed Parameter as a comment. The constant value requires type conversion to match the output data type.
When the constant value is 500 and the output data type is int32, the code generator adds Computed Parameter as a comment. The constant value requires type conversion to match the output data type.