Documentation Center

  • Trial Software
  • Product Updates

ModelAdvisor.run

Package: ModelAdvisor

Run Model Advisor checks on systems

Syntax

SysResultObjArray = ModelAdvisor.run(SysList,CheckIDList,Name,Value)
SysResultObjArray = ModelAdvisor.run(SysList,'Configuration',FileName,Name,Value)

Description

SysResultObjArray = ModelAdvisor.run(SysList,CheckIDList,Name,Value) runs the Model Advisor on the systems provided by SysList with additional options specified by one or more optional Name,Value pair arguments. CheckIDList contains cell array of check IDs to run.

SysResultObjArray = ModelAdvisor.run(SysList,'Configuration',FileName,Name,Value) runs the Model Advisor on the systems provided by SysList. The list of checks to run is specified using a Model Advisor configuration file, specified by FileName.

Input Arguments

SysList

Cell array of systems to run.

CheckIDList

Cell array of check IDs to run. For details on how to find check IDs, see Finding Check IDs.

CheckIDList optionally can include input parameters for specific checks using the following syntax; {'CheckID','InputParam',{'IP','IPV'}}, where IP is the input parameter name and IPV is the corresponding input parameter value. You can specify several input parameter name and value pair arguments in any order as IP1,IPV1,…,IPN,IPVN.

FileName

Name of the Model Advisor configuration file. For details on creating a configuration file, see Organize Checks and Folders Using the Model Advisor Configuration Editor.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

'DisplayResults'

Setting DisplayResults to 'Summary' displays a summary of the system results in the Command Window. Setting DisplayResults to 'Details' displays the following in the Command Window:

  • Which system the Model Advisor is checking while the run is in progress.

  • For each system, the pass and fail results of each check.

  • A summary of the system results.

Setting DisplayResults to 'None' displays no information in the Command Window.

Default: 'Summary'

'Force'

Setting Force to 'On' removes existing modeladvisor/system folders. Setting Force to 'Off' prompts you before removing existing modeladvisor/system folders.

Default: 'Off'

'ParallelMode'

Setting ParallelMode to 'On' runs the Model Advisor in parallel mode if you have a Parallel Computing Toolbox™ license and a multicore machine.

Default: 'Off'

'TempDir'

Setting TempDir to 'On' runs the Model Advisor from a temporary working folder, to avoid concurrency issues when running using a parallel pool. For more information, see Resolving Data Concurrency Issues. Setting TempDir to 'Off' runs the Model Advisor in the current working folder.

Default: 'Off'

'ShowExclusions'

Setting ShowExclusions to 'On' lists Model Advisor check exclusions in the report. Setting ShowExclusions to ‘Off' does not list Model Advisor check exclusion in the report.

Default: 'On'

Output Arguments

SysResultObjArray

Cell array of ModelAdvisor.SystemResult objects, one for each model specified in SysList. Each ModelAdvisor.SystemResult object contains an array of CheckResultObj objects. Save SysResultObjArray to review results at a later time without having to rerun the Model Advisor (see Understanding the Save and Load Process).

CheckResultObj

Array of ModelAdvisor.CheckResult objects, one for each check that runs.

Examples

Runs the Model Advisor checks Check model diagnostic parameters and Check for fully defined interface on the sldemo_auto_climatecontrol/Heater Control and sldemo_auto_climatecontrol/AC Control subsystems:

% Create list of checks and models to run.
CheckIDList ={'mathworks.maab.jc_0021',...
    'mathworks.iec61508.RootLevelInports'};
SysList={'sldemo_auto_climatecontrol/Heater Control',...
    'sldemo_auto_climatecontrol/AC Control'};

% Run the Model Advisor.
SysResultObjArray = ModelAdvisor.run(SysList,CheckIDList);
 

Runs the Model Advisor configuration file slvnvdemo_mdladv_config.mat on the sldemo_auto_climatecontrol/Heater Control and sldemo_auto_climatecontrol/AC Control subsystems:

% Identify Model Advisor configuration file.
% Create list of models to run.
fileName = 'slvnvdemo_mdladv_config.mat';
SysList={'sldemo_auto_climatecontrol/Heater Control',...
    'sldemo_auto_climatecontrol/AC Control'};

% Run the Model Advisor.
SysResultObjArray = ModelAdvisor.run(SysList,'Configuration',fileName);

Alternatives

  • Use the Model Advisor GUI to run each system, one at a time.

  • Create a script or function using the Simulink.ModelAdvisor class to run each system, one at a time.

More About

expand all

Tips

  • If you have a Parallel Computing Toolbox license and a multicore machine, Model Advisor can run on multiple systems in parallel. You can run the Model Advisor in parallel mode by using ModelAdvisor.run with ‘ParallelMode' set to ‘On'. By default, ‘ParallelMode' is set to ‘Off'. When you use ModelAdvisor.run with ‘ParallelMode' set to ‘On', MATLAB® automatically creates a parallel pool.

See Also

| | |

Tutorials

Was this topic helpful?