Documentation Center

  • Trial Software
  • Product Updates

Customizing a System Design Description Report: Part III

This example shows you how to use Simulink® Report Generator™ to customize a System Design Description report for a model. The default version of the report provides information about a system design represented by a Simulink model. You can adapt the report to meet your needs.

This example shows you how to customize a report called System Design Description. The Simulink Report Generator product creates a default version of this report automatically from a Simulink model that you choose. However, you can generate a customized version of this report -- for example, to adhere to your organization's documentation standards.

This example assumes that you completed the previous customization described in "Customizing a System Design Description Report: Part II". In the previous example, you customized the System Design Description by adding new components to the report template. This example introduces you to a few more components. In particular, you will add components that capture the simulation results for inclusion in the report.

You can customize the System Design Description for the Simulink example model, sldemo_autotrans, which represents an automotive drivetrain. To open the example model, run the following command:

open_system('sldemo_autotrans')

Open Report Explorer

From the Simulink model Tools menu, select Report Generator.

The Report Explorer graphical user interface opens.

Open the Custom Template in Report Explorer

In Report Explorer, open the custom template that you created in the previous example, "Customizing a System Design Description Report: Part II".

For your convenience, a version of the custom template is provided. To open the template in Report Explorer, run the following command:

setedit(fullfile(matlabroot, 'toolbox', 'rptgenext', 'rptgenextdemos', 'sdd', 'html', 'sdd_images', 'sdd_customize_part_iii','sdd_custom_blocktypecount.rpt'))

Simulate Model and Observe Results

From the Simulink model Simulation menu, select Start to simulate the model. After the simulation is complete, observe the results in the PlotResults Scope block.

The default System Design Description report provides details regarding all blocks in a model; however, it does not capture the results from model simulation. This example shows you how to customize the System Design Description by adding a new chapter that includes the simulation results that the Scope block displays.

Insert Chapter/Subsection Component

Start by adding a new chapter to the template. In Report Explorer, in the hierarchy pane, select the Title Page component. From the list of components in the center pane, select the Chapter/Subsection component. In the right-hand pane, click the Add component to current report button.

Report Explorer inserts a new Chapter component after the Title Page. Use the arrow buttons in the Report Explorer toolbar to move the new chapter to the end of the template, so that it is the last chapter in the report.

In the hierarchy, select the new Chapter component; in the Report Explorer properties pane, specify the component Title property as Simulation Results.

Insert Paragraph Component

Add a paragraph to the new chapter in your template. In Report Explorer, in the hierarchy pane, select the Chapter component. From the list of components in the center pane, select the Paragraph component. In the right-hand pane, click the Add component to current report button.

Report Explorer inserts a new Paragraph component as a child of the Chapter component. In the hierarchy, select the Paragraph component; in the Report Explorer properties pane, for the component Paragraph Text property, specify the following text:

The following figure displays the simulation results:

Insert Model Simulation Component

The Simulink Report Generator software provides a Model Simulation component that executes a model during the report generation process. You can capture and include the most recent simulation results in a report. Add the Model Simulation component to the new chapter in your template. In Report Explorer, in the hierarchy pane, select the Chapter component. From the list of components in the center pane, select the Model Simulation component. In the right-hand pane, click the Add component to current report button. Use the arrow buttons in the Report Explorer toolbar to move the Model Simulation component in the hierarchy so that it follows the Paragraph component. In this case, you do not have to alter the default properties of the component.

Insert Scope Snapshot Component

The Simulink Report Generator software provides a Scope Snapshot component that inserts images of Simulink Scope blocks into a report. Add this component to the new chapter in your template. In Report Explorer, in the hierarchy pane, select the Chapter component. From the list of components in the center pane, select the Scope Snapshot component. In the right-hand pane, click the Add component to current report button. Use the arrow buttons in the Report Explorer toolbar to move the Scope Snapshot component in the hierarchy so that it follows the Model Simulation component.

In the hierarchy, select the Scope Snapshot component; in the Report Explorer properties pane, select the Report on closed scopes property.

Generate the Report

In the Report Explorer toolbar, click the Report button. When the report is complete, an application associated with the specified report format displays the customized System Design Description. The report contains a new chapter whose contents include the paragraph and Scope snapshot that you specified in your template.

Save the Template

From the Report Explorer File menu, select Save As. Specify a location and a file name for your custom report template. By saving a custom template, you can access and reuse it. For instance, you can apply the custom template to other Simulink models to create reports that have the same structure and format.

Further Information

To learn more about the properties of the components that you use in this portion of the example, refer to the Scope SnapshotScope Snapshot and Model SimulationModel Simulation reference pages in the Simulink Report Generator documentation.

Was this topic helpful?