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 CounterModel.

openExample('CounterModel.slx')

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

slbuild('CounterModel');

Close the code generation report.

coder.report.close;

Generate a code generation report.

coder.report.generate('CounterModel');

Open the model CounterModel.

openExample('CounterModel.slx')

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

slbuild('CounterModel/Amplifier');

Close the code generation report.

coder.report.close;

Generate a code generation report for the subsystem.

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

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

Open the model RollAxisAutopilot.

model = 'RollAxisAutopilot';
openExample('ecoder/TraceGeneratedCodeToBlocksExample','supportingFile',model)

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

slbuild(model);

Close the code generation report.

coder.report.close;

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

coder.report.generate(model,...
'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: CounterModel

Data Types: char

Subsystem name specified as a character vector

Example: CounterModel/Amplifier

Data Types: char

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

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 (Embedded Coder).

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 (Embedded Coder).

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 (Embedded Coder).

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 (Embedded Coder).

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 (Embedded Coder).

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 (Embedded Coder).

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 (Embedded Coder).

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 (Embedded Coder).

Example: 'GenerateCodeMetricsReport','on'

Data Types: char

Version History

Introduced in R2012a