| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink Report Generator |
| Contents | Index |
| Learn more about Simulink Report Generator |
You can generate M-code versions of report templates in the form of a MATLAB file (*.m). An M-file of a report template is useful for various purposes, including generating reports and modifying report templates programmatically.
To generate an M-file, load a report template into the Report Explorer and click File > Generate M-File. After the MATLAB file generates, it opens in the MATLAB Editor. The filename for the generated file is the report template filename, preceded by "build".
Generating Reports from MATLAB files
This example generates a MATLAB file from the figloop_tutorial.rpt report template, which is part of the MATLAB Report Generator software. The example then uses the report function to generate a report from the MATLAB file. For more information about this function, see the report reference page.
Start the Report Explorer by entering report in the MATLAB Command Window.
In the Options pane in the middle, double-click figloop_tutorial.rpt to open its report template.
In the Outline pane on the left, click Report - figloop_tutorial.rpt to select it.
In the Report Explorer menu bar, click File > Generate M-File.
The MATLAB Report Generator software generates MATLAB code for the figloop_tutorial.rpt report template. It saves this code in the buildfigloop_tutorial.m file in the folder you specify. Part of this file appears in the following figure.

To generate the figloop_tutorial report from this MATLAB file, run the following command in the MATLAB Command Window:
report(buildfigloop_tutorial);
The MATLAB Report Generator software runs and displays the report.

![]() | Creating Log Files | Working with Legacy Report Templates | ![]() |

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