ModelAdvisor.SystemResult
Access system-level Model Advisor results
Description
View Model Advisor results obtained by using the run method.
Creation
To access the properties of a SystemResult object, apply the getResults method to an Advisor.Application object. If you run Model
Advisor by using the ModelAdvisor.run, it returns the results as a
SystemResult object. You can directly access the object
properties.
Properties
Model or subsystem that the Model Advisor analyzes.
Data Types: char
Type of model component that Model Advisor analyzes.
Data Types: char
Numbers of checks with different statues, returned as a structure. The returned structure contains these fields:
NotRun— Number of Model Advisor checks that do not runInformation— Number of Model Advisor checks with informationPassed— Number of Model Advisor checks that passJustified— Number of Model Advisor checks that are JustifiedWarning— Number of Model Advisor checks that warnFailed— Number of Model Advisor checks that failIncomplete— Number of Model Advisor checks that ran incompletely
Data Types: structure
Cell array containing a ModelAdvisor.CheckResult object for each
Model Advisor check. Access these object properties to obtain Model Advisor check
results.
Object Functions
getCheckResults | Access specific Model Advisor check results |
Examples
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.
Results=getResults(app);
Generate and view the Model Advisor report. The Model Advisor runs the check on both
mdlref_basic and mdlref_counter.
report = generateReport(app); web(report)
Close the models.
close_system('mdlref_basic'); close_system('mdlref_counter');
Version History
Introduced in R2015bThe numPass, numFail,
numNotRun, and numWarn properties will be removed in a
future release. To get the numbers of checks with different statuses, access the structure
fields of the new Summary property.
The CheckResultObjs property is now called
CheckResults. The support for references to
CheckResultObjs will be removed in a future release. You can also
access the results of all or specific checks by using the new getCheckResults function.
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.
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.
América
- 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)