Run Model Advisor from MATLAB file
To run the Model Advisor, use instances of this class in MATLAB® programs. For example, you can perform a standard set of checks.
Many Simulink.ModelAdvisor
object methods 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 methods
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.
Find | Action |
---|---|
Check Title, ID, or location of the MATLAB source code |
|
Check ID |
|
Check IDs for selected checks in a folder |
|
If you have a Simulink®
Check™ license, consider using the ModelAdvisor.run
(Simulink Check) function or the Advisor.Application
(Simulink Check)
run
(Simulink Check) method instead of the Simulink.ModelAdvisor
runCheck
or runTask
functions.
Consider using Advisor.Application
class if you have a large model with
subsystems and model references. Advisor.Application
does not run checks on
library models. 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.
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:
where system is the name of the model or subsystem that you want to check. Your program
can then use the Model Advisor object methods to initialize and run the Model Advisor
checks. ma
= Simulink.ModelAdvisor.getModelAdvisor(system
)
closeReport | Close Model Advisor 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 |
displayReport | Display report in Model Advisor window |
exportReport | Create copy of Model Advisor report |
filterResultWithExclusion | Filter excluded objects |
getBaselineMode | Determine whether Model Advisor is in baseline data generation mode |
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 |
getCheckResult | Get Model Advisor check results |
getCheckResultData | Obtain Model Advisor check result data |
getCheckResultStatus | Obtain Model Advisor check result status |
getGroupAll | Get all groups of checks that Model Advisor runs |
getInputParameters | Get Model Advisor check input parameters |
getListViewParameters | Get Model Advisor checklist parameters displayed in checklist view |
Simulink.ModelAdvisor.getModelAdvisor | Get Model Advisor object for system or subsystem |
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 |
Simulink.ModelAdvisor.openConfigUI | Starts Model Advisor Configuration Editor |
Simulink.ModelAdvisor.reportExists | Determine whether Model Advisor report exists for model or subsystem |
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 |
setActionEnable | Set status for check action |
setBaselineMode | Set Model Advisor baseline mode |
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 |
setListViewParameters | Specify list-view parameters for check |
setInputParameters | Specify input parameters |
verifyCheckRan | Verify that Model Advisor ran a set of checks |
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 |