By default, when the Model Advisor runs checks, it generates an HTML report of check results
in the slprj/modeladvisor/
folder.
On Windows® platforms, you can generate Model Advisor reports in HTML, Adobe® PDF, and Microsoft® Word .docx formats.model_name
The beginning of the Model Advisor reports contain the:
Model name
Simulink® version
System
Treat as Referenced Model
Model version
Current run
Use these steps to generate a Model Advisor report when executing the checks. This report is in HTML format.
In the left pane of the Model Advisor, select the checks you want to run.
Click on the folder that contains the checks and, in the right pane of the Model Advisor, select Show report after run.
Click Run Selected Checks. When complete, the Model
Advisor automatically opens an HTML
version of
the report.
To save, right-click on the report and select Save As
To generate a Model Advisor report in Adobe PDF or Microsoft Word:
In the left pane of the Model Advisor, select the checks you want to run. Click on the folder that contains the checks and, in the right pane of the Model Advisor, select Run Selected Checks.
When complete, reselect the folder and click Generate Report in the right pane of the Model Advisor.
In the Generate Model Advisor Report dialog box:
Enter the path to the folder where you want to generate the report.
Provide a file name.
Use File format to select
HTML
,
PDF
, or
Word
.
Click OK. The Model Advisor generates the report and saves it to the designated location. If you selected View report after generation, the report opens automatically.
If you have a MATLAB® Report Generator™ license, you can modify the default template that the Model Advisor uses to generate the report in PDF or Microsoft Word.
The default template contains fields that the Model Advisor uses to populate the generated report with information about the analysis. If you want your Model Advisor report to contain the analysis information, do not delete the fields. When the Model Advisor generate the report, analysis information overrides the text that you enter in the template field.
Template Field | In generated report, displays |
---|---|
ModelName | Model name |
SimulinkVersion | Simulink version |
SystemName | System name |
TreatAsMdlRef | Whether or not model is treated as a referenced model |
ModelVersion | Model version |
CurrentRun | Model Advisor analysis time stamp |
PassCount | Number of checks that pass |
FailCount | Number of checks that fail |
WarningCount | Number of checks that cause a warning |
NrunCount | Number of checks that did not run |
TotalCount | Total number of checks |
CheckResults | Results for each check |
This example shows how to add a header to a PDF version of a Model Advisor report.
Using Microsoft Word, open the default template
.matlabroot
/toolbox/simulink/simulink/modeladvisor/resources/templates/default.dotx
Rename and save the template default.dotx
to
a writable location. For example, save template default.dotx
to C:/work/ma_format/mytemplate.dotx
.
In the template C:/work/ma_format/mytemplate.dotx
file, add a header. For
example, in the template header, add the text My Custom
Header
. Save the template as a Microsoft Word .dotx
file.
In the Model Advisor window Report pane, click Generate Report.
In the Generate Model Advisor Report dialog box:
Enter the path to the folder where you want to generate the report and provide a file name.
Set File format to PDF
.
Select View report after generation.
Set Report template to C:\work\ma_format\mytemplate.dotx
.
Click OK. The Model Advisor generates the report in PDF format with the custom header.
ModelAdvisor.summaryReport
| viewReport