The Model Dependency Viewer displays a dependency view of a model. The dependency view is a graph of all the models, subsystems, and libraries referenced directly or indirectly by the model. You can use the dependency view to find and open referenced files. 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, subsystem, and library files referenced by a
top model. A referenced file 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
aero_guidance model references two
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
aerospace library references itself.
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 References) 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
sldemo_mdlref_depgraph contains two references to the model
In an instance view, boxes represent a top model and model references. Boxes
representing accelerated-mode instances (see Choose Simulation Modes for Model Hierarchies) 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
operates 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 referenced 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 Choose Simulation Modes for Model Hierarchies). For
example, this dependency instance view indicates one instance of the referenced model
ModDepViewerSub runs in processor-in-the-loop mode.
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, on the Modeling tab, on the far right of the Design section, click the arrow. Under System Design, click Model Dependencies.
Select the User-Defined Libraries check box. The viewer shows dependencies on user-defined libraries, if such dependencies exist.
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
– 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.
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
sldemo_mdlref_heat2cost and click
Highlight Block. The corresponding block in the
sldemo_mdlref_depgraph model appears highlighted.
In the dependency viewer, double-click the
sldemo_mdlref_heat2cost box to open the model in the Simulink® Editor.