ModelAdvisor.CheckResult
Access Model Advisor check results
Description
View Model Advisor check results obtained by using the run
method.
Creation
To access the properties of a CheckResult
object, access the
CheckResultsObjs
property of a System.Result
object.
Properties
system
— Model or subsystem that Model Advisor analyzes
character vector
Model or subsystem that the Model Advisor analyzes.
Data Types: char
status
— Model Advisor check status
Failed
| Incomplete
| Justified
| NotRun
| Passed
| Warning
Status of Model Advisor check
Data Types: enum
checkID
— Model Advisor check ID
character vector
Model Advisor check ID
Data Types: char
checkName
— Model Advisor check name
character vector
Name of Model Advisor check
Data Types: char
Examples
Run Model Advisor Checks on Referenced Model
This example shows how to run a check on model
sldemo_mdlref_counter
referenced from
sldemo_mdlref_basic
.
In the Command Window, open model sldemo_mdlref_basic
and
referenced model sldemo_mdlref_counter
.
openExample('sldemo_mdlref_basic'); openExample('sldemo_mdlref_counter');
Save a copy of the models to a work folder, renaming them to
mdlref_basic
and mdlref_counter
.
save_system('sldemo_mdlref_basic','mdlref_basic'); save_system('sldemo_mdlref_counter','mdlref_counter');
In mdlref_basic
, change model reference from
sldemo_mdlref_counter
to mdlref_counter
. Save
mdlref_basic
.
set_param('mdlref_basic/CounterA','ModelName','mdlref_counter'); set_param('mdlref_basic/CounterB','ModelName','mdlref_counter'); set_param('mdlref_basic/CounterC','ModelName','mdlref_counter'); save_system('mdlref_basic');
Set root model to mdlref_basic
.
RootModel='mdlref_basic';
Create an Application
object.
app = Advisor.Manager.createApplication();
Set root analysis.
setAnalysisRoot(app,'Root',RootModel);
Clear check instances from Model Advisor analysis.
deselectCheckInstances(app);
Select check Identify unconnected lines, input ports, and output ports using check instance ID.
instanceID = getCheckInstanceIDs(app,'mathworks.design.UnconnectedLinesPorts'); checkinstanceID = instanceID(1); selectCheckInstances(app,'IDs',checkinstanceID);
Run Model Advisor analysis.
run(app);
Get analysis results and view the properties of the
ModelAdvisor.SystemResult
and
ModelAdvisor.CheckResult
objects.
getResults(app);
Close the models.
close_system('mdlref_basic'); close_system('mdlref_counter');
Version History
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)