Main Content

Generate Model Advisor Reports

By default, when the Model Advisor runs checks, it generates an HTML report of check results in the slprj/modeladvisor/model_name folder. On Windows® platforms, you can generate Model Advisor reports in HTML, Adobe® PDF, and Microsoft® Word .docx formats.

The beginning of the Model Advisor reports contain the:

  • Model name

  • Simulink® version

  • System

  • Treat as Referenced Model

  • Model version

  • Current run

Generate Results Report After Executing Model Advisor Checks

To generate a Model Advisor report in Adobe PDF or Microsoft Word:

  1. In the left pane of the Model Advisor, select the checks you want to run. Click on the folder that contains the checks and, from the toolstrip, click Run Checks.

  2. When complete, from the toolstrip, click Report.

  3. In the Save Report dialog box:

    • Enter the path to the folder where you want to generate the report.

    • Provide a file name.

    • Click Save to generate a report in HTML format.

  4. Use can change the File format to PDF, or WORD using the drop-down options of the Report button.

  5. The Model Advisor generates the report and saves it to the designated location.

Modify Template for Model Advisor Check Results Report

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 FieldIn generated report, displays
ModelNameModel name
SimulinkVersionSimulink version
SystemNameSystem name
TreatAsMdlRefWhether or not model is treated as a referenced model
ModelVersionModel version
CurrentRunModel Advisor analysis time stamp
PassCountNumber of checks that pass
JustifiedCountNumber of checks that are justified
IncompleteCountNumber of checks that fail to run to completion
FailCountNumber of checks that fail
WarningCountNumber of checks that cause a warning
NrunCountNumber of checks that did not run
TotalCountTotal number of checks
CheckResultsResults for each check

This example shows how to add a header to a PDF version of a Model Advisor report.

  1. Using Microsoft Word, open the default template matlabroot/toolbox/simulink/simulink/modeladvisor/resources/templates/default.dotx.

  2. Rename and save the template default.dotx to a writable location. For example, save template default.dotx to C:/work/ma_format/mytemplate.dotx.

  3. 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.

    Model Advisor Report template with the custom header "My Custom Header"

  4. From the Model Advisor toolstrip, click Report drop-down, and select Template File.

  5. In the Select Template for Report dialog box, enter the path to the folder where your custom template is placed. In this case, the path is C:/work/ma_format/mytemplate.dotx.

  6. Click OK.

  7. From the toolstrip, click Report drop-down, and select PDF. The Model Advisor generates the report in PDF format with the custom header.

    Model Advisor Report in PDF format with the custom header "My Custom Header"

See Also

|

Related Topics