The Model Dependency Viewer displays a dependency view of a model. The dependency view is a graph of all the models and libraries referenced directly or indirectly by the model. You can use the dependency view to find and open referenced libraries and models. To identify and package all required files instead, see Analyze Model Dependencies.
The Model Dependency Viewer allows you to choose between the file dependency view and the model instances view.
The file dependency view shows the model and library files referenced
by a top model. A referenced model or library appears only once in
the view even if it is referenced more than once in the model. The
figure shows a dependency view. Gray blocks represent model files
and blue boxes represent libraries. Arrows represent dependencies.
For example, the arrows in this view indicate that the
references two libraries:
An arrow from a library that points to itself indicates that
the library references itself. Blocks in the library reference other
blocks in that same library. The example view shows that the
A file dependency view can include a legend that identifies the model in the view and the date and time the view was created.
The model instances view shows every reference to a model in
a model reference hierarchy (see Model Reference)
with the top model at the root of the hierarchy. If a model hierarchy
references the same model more than once, the referenced model appears
multiple times in the instance view, once for each reference. For
example, this view indicates that the model reference hierarchy for
two references to the model
In an instance view, boxes represent a top model and model references.
Boxes representing accelerated-mode instances (see Referenced Model Simulation Modes) have filled triangles
in their corners; boxes representing normal-mode instances have empty
triangles in their corners. For example, the previous diagram shows
that one of the references to
in normal mode, and the other operates in accelerated mode.
Boxes representing protected referenced models show
the protected models
.slxp extension. You cannot
expand protected reference models.
An instance view displays information icons on instance boxes to indicate an override in simulation mode for that instance. For example, if a referenced model is configured to run in normal mode and it runs in accelerator mode, its simulation mode is overridden. This override occurs because another referenced model that runs in accelerator mode directly or indirectly references it.
Processor-in-the-Loop Mode Indicator. An instance view appends PIL to the names of models that run
in processor-in-the-loop mode (see Specify the Simulation Mode).
For example, this dependency instance view indicates one instance
of the referenced model
ModDepViewerSub runs in
This example shows how to use Model Dependency Viewer to view model file and library dependencies of the model. To identify and package all required files instead, see Analyze Model Dependencies.
Open the model
To open the Model Dependency Viewer in file dependency view, select Analysis > Model Dependencies > Model Dependency Viewer > Models Only.
Select the User-Defined Libraries check box. The viewer shows dependencies on user-defined libraries, if such dependencies exist.
You can open this view directly from the Simulink Editor by selecting Analysis > Model Dependencies > Model Dependency Viewer > Models & Libraries.
Select the Built-In Libraries check box to show dependencies on MathWorks® built-in libraries.
To view the dependencies laid out horizontally, click Options and, under Layout, select Horizontal.
Collapse the dependencies of
Click – on the box for
Hide the dependency viewer legend. Click Options and, under Display, select the Legend check box.
Click Model Instances to open the model instance view.
You can open this view directly from the Simulink® editor by selecting Analysis > Model Dependencies > Model Dependency Viewer > Referenced Model Instances.
To display full paths in the boxes representing the instances, click Options and, under Display, select the Full path check box. Each box in the instance view displays the path of the Model block corresponding to the instance. The name of the referenced model appears in parentheses.
Select the box for
click Highlight Box. The corresponding block
sldemo_mdlref_depgraph model appears highlighted.
In the dependency viewer, double-click the
to open the model in the Simulink Editor.