Main Content

生成模型的顾问报告

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

The beginning of the Model Advisor reports contain the:

  • Model name

  • 万博1manbetx®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 orMicrosoft 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, clickRun Checks.

  2. When complete, from the toolstrip, clickReport.

  3. In theSave Reportdialog box:

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

    • Provide a file name.

    • ClickSaveto generate a report inHTMLformat.

  4. Use can change theFile formattoPDF, orWORD使用的下拉选项Reportbutton.

  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 aMATLAB®Report Generator™license, you can modify the default template that the Model Advisor uses to generate the report in PDF orMicrosoft 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
JustifiedCount Number of checks that are justified
IncompleteCount Number of checks that fail to run to completion
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.

  1. UsingMicrosoft Word, open the default templatematlabroot/toolbox/simulink/simulink/modeladvisor/resources/templates/default.dotx.

  2. Rename and save the templatedefault.dotxto a writable location. For example, save templatedefault.dotxtoC:/work/ma_format/mytemplate.dotx.

  3. In the templateC:/work/ma_format/mytemplate.dotxfile, add a header. For example, in the template header, add the textMy Custom Header. Save the template as a Microsoft Word.dotxfile.

    Model Advisor Report template with the custom header

  4. From the Model Advisor toolstrip, clickReportdrop-down, and selectTemplate File.

  5. In theSelect Template for Reportdialog box, enter the path to the folder where your custom template is placed. in our case, the path isC:/work/ma_format/mytemplate.dotx.

  6. ClickOK.

  7. From the toolstrip, clickReportdrop-down, and selectPDF. The Model Advisor generates the report in PDF format with the custom header.

    Model Advisor Report in PDF format with the custom header

See Also

|

Related Topics