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
CheckResults
property of a SystemResult
object or use
the getCheckResults
function.
Properties
Model or subsystem that the Model Advisor analyzes, specified as a character vector.
Data Types: char
Status of Model Advisor check, specified as either:
"Failed"
"Information"
"Incomplete"
"Justified"
"NotRun"
"Passed"
"Warning"
Data Types: string
Model Advisor check ID, specified as a character vector.
Data Types: char
Name of Model Advisor check, specified as a character vector.
Data Types: char
Check instance ID, specified as a character vector. The instance ID represents the instance of a check in the Model Advisor configuration.
Check results in text, specified as a character vector.
Check result details, specified as a ModelAdvisor.ResultDetail
object.
Examples
This example shows how to run the check Check
root model Inport block specifications on the model
sldemo_mdlref_basic
and its referenced model
sldemo_mdlref_counter
, and then access the results.
Open the example model sldemo_mdlref_basic
. In the MATLAB® Command Window, enter:
openExample("sldemo_mdlref_basic")
Create an Advisor.Application
object that you can use to run Model
Advisor checks across the model reference hierarchy in
sldemo_mdlref_basic
.
app = Advisor.Manager.createApplication();
Specify which model or subsystem to analyze. For this example, specify the model
sldemo_mdlref_basic
as the root of the Model Advisor
analysis.
setAnalysisRoot(app,Root = "sldemo_mdlref_basic");
Suppose that you only want to run the check Check root model Inport block specifications.
By default, the Advisor.Application
object is set up to run each
check instance in the current Model Advisor configuration and has
all check instances selected. Clear the check
instances to remove all check instances from the Model
Advisor
analysis.
deselectCheckInstances(app);
Now there are no checks selected for Model Advisor analysis.
Specify that you want Model Advisor to run the check Check root model Inport block specifications by finding and using the check instance ID.
checkID = "mathworks.design.RootInportSpec";
instanceIDs = getCheckInstanceIDs(app,checkID);
instanceID = instanceIDs(1);
selectCheckInstances(app,ID = instanceID);
Now the check Check root model Inport block specifications is selected for Model Advisor analysis.
Run the Model Advisor analysis.
run(app);
Model Advisor runs the check Check root model Inport block
specifications on both sldemo_mdlref_basic
and
sldemo_mdlref_counter
.
Get the results from the Model Advisor analysis.
res = getResults(app)
res = 1×2 SystemResult array with properties: System Type Summary CheckResults
Model Advisor returns a ModelAdvisor.SystemResult
object for each
model. The property CheckResults
contains the
ModelAdvisor.CheckResult
objects.
View the ModelAdvisor.CheckResult
object for one of the
models.
checkResult = res(1).CheckResults
checkResult = 1×2337 CheckResult array with properties: System Status CheckID InstanceID CheckName ResultText ResultDetails
You can use the properties of ModelAdvisor.CheckResult
to inspect
the results from the Model Advisor analysis. Note that you can also generate a Model
Advisor report for the Model Advisor analysis. For more information, see generateReport
.
Version History
Introduced in R2015bThe ModelAdvisor.CheckResult
contains these new properties:
InstanceID
– Check instance IDResultText
– Check result in text formatResultDetails
– Check result detailsModelAdvisor.ResultDetail
objects
The valid values for the status
property were updated to the string values:
"Failed"
"Incomplete"
"Justified"
"NotRun"
"Passed"
"Warning"
The valid values for the status
property were updated to the
enumerated values:
Failed
Incomplete
Justified
NotRun
Passed
Warning
The status
property uses a value of:
'Warning'
in the check result fromModelAdvisor.run
'Warn'
in the check result fromAdvisor.Application.run
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.
Seleziona un sito web
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.
Americhe
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- 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)