Main Content

Advisor.Manager Class

Namespace: Advisor

Manage Model Advisor applications

Description

Use Advisor.Manager to create, get, and refresh Model Advisor applications. You can use Advisor.Manager to:

  • Refresh the Model Advisor check information cache. You must refresh the cache if you create or modify Model Advisor configuration files or sl_customization.m files for custom Model Advisor checks.

  • Create or access an Advisor.Application object that can run Model Advisor checks across model reference hierarchies and variants.

    Note

    If your model does not use model references or variants, use the function ModelAdvisor.run instead of Advisor.Application. ModelAdvisor.run can run Model Advisor checks on models and subsystems, and has the option to run on multiple systems in parallel.

Methods

expand all

Examples

collapse all

If you need to run Model Advisor across a model hierarchy or across active and inactive variants, run Model Advisor using an Advisor.Application object. This example shows how to create an Advisor.Application, specify the AnalyzeVariants argument, and run Model Advisor on a parent model and its referenced models.

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();

In this example, the models do not use variants. But if you want Model Advisor to run on both the active and inactive variants in your models, specify AnalyzeVariants as true.

app.AnalyzeVariants = true;

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");

When you specify a model as the analysis root for an Advisor.Application object, Model Advisor will analyze that model and any referenced models. For more information, see setAnalysisRoot.

Run the Model Advisor analysis.

run(app);

Model Advisor runs on both sldemo_mdlref_basic and the referenced model sldemo_mdlref_counter.

For more information, see Advisor.Application.

Version History

Introduced in R2015b