Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB Report Generator   

Working with Looping Components

About Looping Components

A looping component runs its child components a specified number of times. There are several looping components, including logical loops and Handle Graphics loops.

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 template, included with the MATLAB Report Generator software, creates a report that documents multiple Handle Graphics figures.

For more information, see Understanding Handle Graphics Objects in the MATLAB getting started documentation.

Editing the Figure Loop Tutorial Report Template

To edit the figure loop tutorial report template, at the MATLAB command prompt, enter the following command:

setedit figloop-tutorial

About Figures

To use this tutorial, you must understand the following concepts :

Figure Properties

The following table shows the values for the properties of the figures used in this tutorial.

NameHandleVisibleHandleVisibilityTag
Membrane Data1

on

on

membrane
Invisible Membrane Data2

off

on

membrane
An Application3

on

off

app
An Invisible Application4

off

off

app
Peaks Data5

on

on

peaks

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. Invisible Membrane Data and An Invisible Application do not because they are invisible.

Editing Figure Loop Components

Select the Figure Loop component from the Outline pane on the left. The Properties pane for the Figure Loop component appears.

Looping on the Current Figure

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.

Looping on Visible Figures

To include snapshots of all visible figures in your report, select Visible figures in theInclude figures selection list. This option inserts a snapshot and Property Table for all figures that are currently open and visible.

Including only Figures with HandleVisibility='on'.  

  1. Select the Data figures only (Exclude applications) option to exclude figures from the loop whose HandleVisibility parameter is 'off'.

  2. Click the Report button to generate the report.

The Membrane Data and Peaks Data figures appear in the generated report.

Including All Figures.  

  1. Clear the Data figures only (Exclude applications) option.

  2. Click Report to generate the report.

All figures, regardless of the value of their HandleVisibility parameter, appear in the report.

Looping on Figures with Tags

To include figures specified tags in the report:

  1. Select the All figures with tags option in theInclude figures selection list.

  2. Specify a tag in the text box.

  3. Click Report to generate the report.

All figures with the specified tag, regardless of the value of their HandleVisibility parameter, appear in the report.

Modifying Section Options

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.   When you select this option, 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. It precedes section titles with object titles in the generated report.

  1. Clear this option and generate the figloop-tutorial report.

    The figures produced by the loop are:

    Membrane Data
    Invisible Membrane Data
    An Application
    An Invisible Application
    
  2. Now select this option and regenerate the report.

    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.   Select this option to create a hyperlink to the object in the generated report.

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS