setAnalysisRoot
Class: Advisor.Application
Namespace: Advisor
Specify model reference hierarchy for Model Advisor analysis
Description
Specify the model reference hierarchy for an Application
object analysis.
Input Arguments
Model Advisor application object, specified as an
Advisor.Application
object. You
can use an Advisor.Application
object to run Model Advisor checks on a model
reference hierarchy. Create an
Advisor.Application
object by
using the method Advisor.Manager.createApplication
.
Model name, specified as a character vector.
Example: setAnalysisRoot(app,'Root','sldemo_mdlref_basic')
Data Types: char
Subsystem path, specified as a character vector.
Example: setAnalysisRoot(app,'Root','sldemo_mdlref_basic/CounterA','RootType','Subsystem')
Data Types: char
Examples
This example shows how to create an Advisor.Application
object and specify a model as the root of the Model Advisor
analysis.
Open the example model
sldemo_mdlref_basic
. In the
MATLAB® Command Window,
enter:
openExample('sldemo_mdlref_basic');
The model sldemo_mdlref_basic
is a
parent model that contains three
Model blocks:
CounterA
,
CounterB
, and
CounterC
. These blocks
reference the same model,
sldemo_mdlref_counter
, which is
a separate model and not a subsystem of
sldemo_mdlref_basic
.
Create an Advisor.Application
object
that you can use to run Model Advisor
checks.
app = Advisor.Manager.createApplication();
Specify which model 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);
Specify that you want Model Advisor to run only 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);
Run the Model Advisor analysis.
run(app);
Model Advisor runs on both
sldemo_mdlref_basic
and the
referenced model
sldemo_mdlref_counter
.
This example shows how to create an Advisor.Application
object and specify a subsystem as the root of the Model
Advisor analysis.
Open the example model
slexVariantManagement
. In the
MATLAB Command Window,
enter:
openExample('slexVariantManagement')
Create an Advisor.Application
object
that you can use to run Model Advisor
checks.
app = Advisor.Manager.createApplication();
Specify the subsystem Controller
as
the root of the Model Advisor
analysis.
setAnalysisRoot(app,'Root','slexVariantManagement/Controller',... 'RootType','Subsystem');
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);
Specify that you want Model Advisor to run only 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);
Run the Model Advisor analysis.
run(app);
Model Advisor runs on the
Controller
subsystem and its
referenced models.
For more information, see Advisor.Application
.
Version History
Introduced in R2015b
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.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.
Amerika
- 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)