Main Content

Comment style

Specify comment style in generated code

Model Configuration Pane: Code Generation / Comments

Description

Specify comment style in the generated C/C++ code.

Dependencies

This parameter:

  • Appears only for ERT-based targets.

  • Requires Embedded Coder® when generating code.

Settings

Auto (default) | Multi-line | Single-line
Auto

For C code, generate single- or multiple-line comments delimited by /* and */. For C++ code, generate single-line comments preceded by //.

Multi-line

Generate single- or multiple-line comments delimited by /* and */.

Example of code generated by using the multiline comment style is:

/* Sum: '<Root>/Sum' incorporates:
 *  Constant: '<Root>/INC'
 *  UnitDelay: '<Root>/X'
 */
rtDW.X_g++;
Single-line

Generate single-line comments preceded by //.

Example of code generated by using the single-line comment style is:

// Sum: '<Root>/Sum' incorporates:
//   Constant: '<Root>/INC'
//   UnitDelay: '<Root>/X'

rtDW.X_g++;

Note

For C code generation, select Single-line only if your compiler supports it.

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

Programmatic Use

Parameter: CommentStyle
Type: character vector
Value: Auto | Multi-line | Single-line
Default: Auto

Version History

Introduced in R2014a