Archive and View Results

You can archive and view the results of running the Model Advisor programmatically as described in the following sections:

Archive Results

After you run the Model Advisor programmatically, you can archive the results for use at another time. 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. For details, see Understanding the Save and Load Process.

For an example of archiving results, see Archive and View Model Advisor Run Results.

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, when you run the function that you created in Create a Function for Checking Multiple Systems, the following results are displayed:

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 (see View Results in 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, run the Model Advisor as follows:

SysResultObjArray = ModelAdvisor.run('sldemo_auto_climatecontrol/Heater Control',...
    'Configuration','slvnvdemo_mdladv_config.mat','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: 29-Oct-2012 16:30:00
         Configuration: slvnvdemo_mdladv_config.mat
         System: sldemo_auto_climatecontrol/Heater Control
         System version: 8.1
         Created by: The MathWorks Inc.
         ============================================================
         (1) Warning: Check model diagnostic parameters [check ID: mathworks.maab.jc_0021]
         ------------------------------------------------------------
         (2) Warning: Check for fully defined interface [check ID: mathworks.iec61508.RootLevelInports]
         ------------------------------------------------------------
         (3) Pass: Check for unconnected objects [check ID: mathworks.iec61508.UnconnectedObjects]
         ------------------------------------------------------------
         (4) Pass: Check for blocks not recommended for C/C++ production code deployment 
[check ID: mathworks.iec61508.PCGSupport]
         ------------------------------------------------------------
         Summary:    Pass    Warning    Fail    Not Run
                      2        2          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. The following graphic is the report that the Model Advisor generates for run_configuration.

To view the Model Advisor Command-Line Summary report after loading an object, use the ModelAdvisor.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. For more information, see Run Model Checks.

    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.

Was this topic helpful?