Main Content

Create code generation report

Document generated code in an HTML report

Model Configuration Pane: Code Generation / Report


The Create code generation report parameter generates an HTML report that provides traceability between the code and elements of the model..


This parameter enables



off (default) | on

Generates a summary of code generation source files in an HTML report. Places the report files in an html subfolder within the build folder. In the report,

  • The Summary section lists version and date information. The Configuration Settings at the Time of Code Generation link opens a noneditable view of the Configuration Parameters dialog that shows the Simulink® model settings, including TLC options, at the time of code generation.

  • The Subsystem Report section contains information on nonvirtual subsystems in the model.

  • The Code Interface Report section provides information about the generated code interface, including model entry point functions and input/output data (requires an Embedded Coder® license and the ERT target).

  • The Traceability Report section allows you to account for Eliminated / Virtual Blocks that are untraceable, versus the listed Traceable Simulink Blocks / Stateflow Objects / MATLAB Scripts, providing a complete mapping between model elements and code (requires an Embedded Coder license and the ERT system target file).

  • The Static Code Metrics Report section provides statistics of the generated code. Metrics are estimated from static analysis of the generated code.

  • The Code Replacements Report section allows you to account for code replacement library (CRL) functions that were used during code generation, providing a mapping between each replacement instance and the Simulink block that triggered the replacement.

In the Generated Files section, you can click the names of source code files generated from your model to view their contents in a MATLAB® Web browser window. In the displayed source code,

  • Global variable instances are hyperlinked to their definitions.

  • If you selected the traceability option Code-to-model, hyperlinks within the displayed source code let you view the blocks or subsystems from which the code was generated. Click on the hyperlinks to view the relevant blocks or subsystems in a Simulink model window (requires an Embedded Coder license and the ERT system target file).

  • If you selected the traceability option Model-to-code, you can view the generated code for a block in the model. To highlight a block's generated code in the HTML report, right-click the block and select C/C++ Code > Navigate to C/C++ Code (requires an Embedded Coder license and the ERT system target file).

  • If you set the Code coverage tool parameter on the Code Generation > Verification pane, you can view the code coverage data and annotations in the generated code in the HTML Code Generation Report (requires an Embedded Coder license and the ERT system target file).


Does not generate a summary of files.

Recommended Settings

EfficiencyNo impact
Safety precaution

No recommendation

Programmatic Use

Parameter: GenerateReport
Type: character vector
Value: 'on' | 'off'
Default: 'off'

Version History

Introduced before R2006a