Main Content

coder.report.generate

Generate HTML code generation report

Description

example

coder.report.generate(model) generates a code generation report for the model. The build folder for the model must be present in the current working folder.

example

coder.report.generate(subsystem) generates the code generation report for the subsystem. The build folder for the subsystem must be present in the current working folder.

example

coder.report.generate(model,Name,Value) generates the code generation report using the current model configuration and additional options specified by one or more Name,Value pair arguments. Possible values for the Name,Value arguments are parameters on the Code Generation > Report pane. Without modifying the model configuration, using the Name,Value arguments you can generate a report with a different report configuration.

Examples

collapse all

Open the model rtwdemo_counter.

open rtwdemo_counter

Build the model. The model is configured to create and open a code generation report.

slbuild('rtwdemo_counter');

Close the code generation report.

coder.report.close;

Generate a code generation report.

coder.report.generate('rtwdemo_counter');

Open the model rtwdemo_counter.

open rtwdemo_counter

Build the subsystem. The model is configured to create and open a code generation report.

slbuild('rtwdemo_counter/Amplifier');

Close the code generation report.

coder.report.close;

Generate a code generation report for the subsystem.

coder.report.generate('rtwdemo_counter/Amplifier');

Generate a code generation report to include a static code metrics report after the build process, without modifying the model.

Open the model rtwdemo_hyperlinks.

open rtwdemo_hyperlinks

Build the model. The model is configured to create and open a code generation report.

slbuild('rtwdemo_hyperlinks');

Close the code generation report.

coder.report.close;

Generate a code generation report that includes the static code metrics report.

coder.report.generate('rtwdemo_hyperlinks',...
'GenerateCodeMetricsReport','on');

The code generation report opens. In the left navigation pane, click Static Code Metrics Report to view the report.

Input Arguments

collapse all

Model name specified as a character vector

Example: rtwdemo_counter

Data Types: char

Subsystem name specified as a character vector

Example: rtwdemo_counter/Amplifier

Data Types: char

Name-Value Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'GenerateWebview','on','GenerateCodeMetricsReport','on' includes a model Web view and static code metrics in the code generation report.

Each Name,Value argument corresponds to a parameter on the Configuration Parameters Code Generation > Report pane. When the configuration parameter GenerateReport is on, the parameters are enabled. The Name,Value arguments are used only for generating the current report. The arguments will override, but not modify, the parameters in the model configuration. The following parameters require an Embedded Coder® license.

Navigation

collapse all

Code-to-model hyperlinks, specified as ‘on’ or ‘off’. Specify ‘on’ to include code-to-model hyperlinks in the code generation report. The hyperlinks link code to the corresponding blocks, Stateflow® objects, and MATLAB® functions in the model diagram. For more information see Code-to-model.

Example: 'IncludeHyperlinkInReport','on'

Data Types: char

Model-to-code highlighting, specified as ‘on’ or ‘off’. Specify ‘on’ to include model-to-code highlighting in the code generation report. For more information see Model-to-code.

Example: 'GenerateTraceInfo','on'

Data Types: char

Model Web view, specified as ‘on’ or ‘off’. Specify ‘on’ to include the model Web view in the code generation report. For more information, see Generate model Web view.

Example: 'GenerateWebview','on'

Data Types: char

Traceability Report Contents

collapse all

Summary of eliminated and virtual blocks, specified as ‘on’ or ‘off’. Specify ‘on’ to include a summary of eliminated and virtual blocks in the code generation report. For more information, see Eliminated / virtual blocks.

Example: 'GenerateTraceReport','on'

Data Types: char

Summary of the Simulink blocks and the corresponding code location, specified as ‘on’ or ‘off’. Specify ‘on’ to include a summary of the Simulink blocks and the corresponding code location in the code generation report. For more information, see Traceable Simulink blocks.

Example: 'GenerateTraceReportSl','on'

Data Types: char

Summary of the Stateflow objects and the corresponding code location, specified as ‘on’ or ‘off’. Specify ‘on’ to include a summary of Stateflow objects and the corresponding code location in the code generation report. For more information, see Traceable Stateflow objects.

Example: 'GenerateTraceReportSf','on'

Data Types: char

Summary of the MATLAB functions and the corresponding code location, specified as ‘on’ or ‘off’. Specify ‘on’ to include a summary of the MATLAB objects and the corresponding code location in the code generation report. For more information, see Traceable MATLAB functions.

Example: 'GenerateTraceReportEml','on'

Data Types: char

Metrics

collapse all

Static code metrics, specified as ‘on’ or ‘off’. Specify ‘on’ to include static code metrics in the code generation report. For more information, see Generate static code metrics.

Example: 'GenerateCodeMetricsReport','on'

Data Types: char

Introduced in R2012a