Main Content

Simulink.ModelAdvisor

Run Model Advisor from MATLAB file

Description

To run the Model Advisor, use instances of this object in MATLAB® programs. For example, you can perform a standard set of checks.

Many Simulink.ModelAdvisor object functions require or return IDs. An ID is a unique identifier for a Model Advisor check, task, or group. IDs must remain constant. A Simulink.ModelAdvisor object includes functions that enable you to retrieve the ID or IDs for:

  • All checks, tasks, and groups

  • Checks belonging to groups and tasks

  • The active check

  • Selected checks, tasks, and groups

To find check IDs in the Model Advisor, use the check context menu.

FindAction
Check ID
  1. In the left pane of the Model Advisor, select the check.

  2. Right-click the check name and select Send Check ID to Workspace. The ID is displayed in the Command Window and sent to the base workspace.

Check IDs for selected checks in a folder
  1. In the left pane of the Model Advisor, select the checks for which you want IDs. Clear the other checks in the folder.

  2. Right-click the folder and select Send Check ID to Workspace. An array of the selected check IDs are sent to the base workspace.

If you have a Simulink® Check™ license, consider using the ModelAdvisor.run (Simulink Check) function or the Advisor.Application (Simulink Check) run (Simulink Check) function instead of the Simulink.ModelAdvisor runCheck or runTask functions.

Consider using Advisor.Application object if you have a large model with subsystems and model references. If you want to run checks on multiple independent models that are not in a model reference hierarchy or you want to leverage parallel processing, use ModelAdvisor.run to run Model Advisor checks on your model.

Creation

Description

MATLAB creates an instance of this object for each model that you open in the current MATLAB session. To get a handle to a model's Model Advisor object, execute this command: ma = Simulink.ModelAdvisor.getModelAdvisor(system) where system is the name of the model or subsystem that you want to check. Your program can then use the Model Advisor object functions to initialize and run the Model Advisor checks.

Input Arguments

expand all

Model or subsystem that the Model Advisor checks.

Data Types: char

Properties

expand all

A value of true displays input parameters in the Model Advisor report. A value of false does not display input parameters in the Model Advisor report.

Data Types: char

Object Functions

expand all

getBaselineMode Determine whether Model Advisor is in baseline data generation mode
setBaselineMode Set Model Advisor baseline mode
verifyCheckResult Generate baseline Model Advisor check results file or compare current check results to baseline check results
verifyCheckResultStatus Verify that a model passed or failed a set of checks
verifyHTML Generate baseline Model Advisor report or compare current report to baseline report
deselectCheck Clear Model Advisor check
deselectCheckAll Clear Model Advisor checks
deselectCheckForGroup Clear Model Advisor checks for groups
deselectCheckForTask Clear Model Advisor checks that belong to a specified task or set of tasks
deselectTask Clear Model Advisor checks that belong to a specified task or set of tasks
deselectTaskAll Clear all Model Advisor tasks
getCheckAll Get check IDs of all Model Advisor checks
getCheckForGroup Get checks belonging to Model Advisor check group
getCheckForTask Get checks belonging to a task
getCheckResultStatusObtain Model Advisor check result status
getGroupAll Get all groups of checks that Model Advisor runs
getSelectedCheck Get currently selected Model Advisor checks
getSelectedSystem Get system that Model Advisor targets
getSelectedTask Get selected Model Advisor tasks
getTaskAll Get tasks run by Model Advisor
runCheck Run currently selected checks
runTask Run currently selected tasks
selectCheck Select checks
selectCheckAll Select all checks
selectCheckForGroup Select check group
selectCheckForTask Select checks for a specific task or tasks
selectTask Select Model Advisor task
selectTaskAll Select all Model Advisor tasks
verifyCheckRan Verify that Model Advisor ran a set of checks
closeReport Close Model Advisor report
displayReport Display report in Model Advisor window
exportReport Create copy of Model Advisor report
filterResultWithExclusion Filter excluded objects
getCheckResult Get Model Advisor check results
getCheckResultDataObtain Model Advisor check result data
getInputParameters Get Model Advisor check input parameters
setActionEnableSet status for check action
setCheckErrorSeverity Set severity of check failure
setCheckResult Set result for currently running check
setCheckResultData Set result data for currently running check
setCheckResultStatus Set status for currently running check
setInputParametersSpecify input parameters

Version History

Introduced in R2006a