| Contents | Index |
| On this page… |
|---|
Logical and looping components execute conditionally, enabling you to decide when a child component executes or how many times a child component executes.
A looping component runs its child components a specified number of times. There are several looping components, including logical loops, Handle Graphics loops, and model and chart loops. For model and chart loops, you can control aspects such as the order in which the report sorts blocks.
The following example uses the Figure Loop, which is representative of many types of loops. The Figure Loop component runs its child components several times. In each iteration, it applies its child components to Handle Graphics figures. The figloop-tutorial report setup file, included with the MATLAB Report Generator software, creates a report that documents multiple Handle Graphics figures.
For background information, see Handle Graphics Objects in the MATLAB documentation.
Open an example report setup file that illustrates using looping components. At the MATLAB command prompt, enter:
setedit figloop-tutorial
To display the Handle Graphics figures, enter the following at the MATLAB command line:
figloopfigures
The figures Membrane Data, An Application, and Peaks Data appear on the screen because their visible property is 'on'. The Invisible Membrane Data and An Invisible Application figures do not appear on screen because their visible property is 'off'. These invisible figures exist, but they are hidden.
Figure Properties describes the properties of figures used in this tutorial.
In the Report Explorer, in the Outline pane on the left, select the Figure Loop component called Figure Loop Section 1.
The Properties pane for the Figure Loop component appears.

You can control what figures get displayed in the report, based on the properties of each figure.
Table 1.1 of the figloop-tutorial report includes a summary of the properties of the figures used in this tutorial.

For this tutorial, you do not change these properties. For background information, see Setting and Querying Property Values in the MATLAB documentation.
To include only the current figure in the report, select Current figure only from the Include figures selection list. In this case, "current figure" refers to the figure that is current when the report generates. This may not be the same figure you selected as the current figure in the Report Explorer before report generation. For example, if the report generation process creates figures in your report, the last figure created with HandleVisibility set to 'on' is the current figure.
To include snapshots of all visible figures in your report, select Visible figures in the Include figures selection list. This option inserts a snapshot and Property Table for all figures that are currently open and visible.
Select the Data figures only (Exclude applications) option to exclude figures from the loop whose HandleVisibility parameter is 'off'.
To generate the report, in the Report Explorer toolbar click the Report button .
In the generated report, scroll down to "Chapter 2 Figures in Report." The Membrane Data and Peaks Data figures appear in the generated report.
To include figures with specified tags in the report:
Select the All figures with tags option in the Include figures selection list.
In the list of tags, delete membrane.
Click Report to generate the report.
The An Application and An Invisible Application figures appear in the report. They both have an app tag.
In a loop, a section refers to a space in the generated report in which information, including text, images, and tables, appears. You can alter the appearance of sections in each loop appear in the report by using the options in the Figure Loop component's Section Options pane.
Create Section for Each Object in Loop. With this option selected, the loop automatically creates an individual section for each object found in the loop. It uses the object title as the section title. This option is useful when a loop does not contain a Chapter/Subsection component that organizes the loop results.
Display the Object Type in the Section Title. Enable this option by selecting Create section for each object in loop. The generated report precedes section titles with object titles.
Enter membrane back in the list of tags.
Generate the figloop-tutorial report.
The figures produced by the loop are:
Membrane Data Invisible Membrane Data An Application An Invisible Application
Enable the Display the Object Type in the Section Title option.
Generate the figloop-tutorial report.
The figures produced are now:
Figure - Membrane Data Figure - Invisible Membrane Data Figure - An Application Figure - An Invisible Application
The figures produced are now:
Figure - Membrane Data Figure - Invisible Membrane Data Figure - An Application Figure - An Invisible Application
Create a Link Anchor for Each Object in Loop. Selecting this option creates a hyperlink to the object in the generated report.
![]() | Summary Table Components | Comparing XML Files Exported from Simulink Models | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |