Main Content

Archive and View Results

Archive Results

After you run the Model Advisor programmatically, you can archive the results. The ModelAdvisor.run function returns a cell array of ModelAdvisor.SystemResult objects, one for each system run. If you save the objects, you can use them to view the results at a later time without rerunning the Model Advisor.

View Results in Command Window

When you run the Model Advisor programmatically, the system-level results of the run are displayed in the Command Window. For example:

Systems passed: 0 of 1
Systems with warnings: 1 of 1
Systems failed: 0 of 1
Summary Report
The Summary Report link provides access to the Model Advisor Command-Line Summary report.

You can review additional results in the Command Window by calling the DisplayResults parameter when you run the Model Advisor. For example, open the example model sldemo_auto_climatecontrol.

openExample('sldemo_auto_climatecontrol')

Run the Model Advisor as follows:

SysResultObjArray = ModelAdvisor.run('sldemo_auto_climatecontrol/Heater Control',...
'mathworks.maab.jc_0021','DisplayResults','Details');
The results displayed in the Command Window are:
         Running Model Advisor
         Running Model Advisor on sldemo_auto_climatecontrol/Heater Control
         ============================================================
         Model Advisor run: 10-Sep-2021 16:51:32
         Configuration: None
         System: sldemo_auto_climatecontrol/Heater Control
         System version: 10.4
         Created by: The MathWorks, Inc.
         ============================================================
         (1) Warning: Check model diagnostic parameters [check ID: mathworks.maab.jc_0021]
         ------------------------------------------------------------
         Summary:    Pass    Warning    Fail    Not Run
                      0        1          0         0      
         ============================================================


         Systems passed: 0 of 1

         Systems with warnings: 1 of 1

         Systems failed: 0 of 1
         Summary Report

To display the results in the Command Window after loading an object, use the viewReport function.

View Results in Model Advisor Command-Line Summary Report

When you run the Model Advisor programmatically, a Summary Report link is displayed in the Command Window. Clicking this link opens the Model Advisor Command-Line Summary report.

Example of Model Advisor Command-Line Summary Report

To view the Model Advisor Command-Line Summary report after loading an object, use the summaryReport function.

View Results in Model Advisor GUI

In the Model Advisor window, you can view the results of running the Model Advisor programmatically using the viewReport function. In the Model Advisor window, you can review results, run checks, fix warnings and failures, and view and save Model Advisor reports.

Tip

To fix warnings and failures, you must rerun the check in the Model Advisor window.

View Model Advisor Report

For a single system or check, you can view the same Model Advisor report that you access from the Model Advisor GUI.

To view the Model Advisor report for a system:

  • Open the Model Advisor Command-Line Summary report. In the Systems Run table, click the link for the Model Advisor report.

  • Use the viewReport function.

To view individual check results:

  • In the Command Window, generate a detailed report using the viewReport function with the DisplayResults parameter set to Details, and then click the Pass, Warning, or Fail link for the check. The Model Advisor report for the check opens.

  • Use the view function.

See Also

| | |

Related Examples

More About