Documentation Center

  • Trial Software
  • Product Updates

Model Dependency Viewer

About Model Dependency Views

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 quickly find and open referenced libraries and models. To identify and package all required files, see instead Analyze Model Dependencies.

The Model Dependency Viewer allows you to choose between the following types of dependency views of a model reference hierarchy.

File Dependency View

A file dependency view shows the model and library files referenced by a top model. A referenced model or library file appears only once in the view even if it is referenced more than once in the model hierarchy displayed in the view. A file dependency view consists of a set of blocks connected by arrows. Blue blocks represent model files; brown boxes, libraries. Arrows represent dependencies. For example, the arrows in the following view indicate that the aero_guidance model references two libraries: aerospace and simulink_need_slupdate.

An arrow that points to the library from which it emerges indicates that the library references itself, i.e., blocks in the library reference other blocks in that same library. For example, the preceding view indicates that the aerospace library references itself.

A file dependency view optionally includes a legend that identifies the model in the view and the date and time the view was created.

Referenced Model Instances View

A referenced model instances view shows every reference to a model in a model reference hierarchy (see Model Reference) rooted at the top model targeted by the view. 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, the following view indicates that the model reference hierarchy rooted at sldemo_mdlref_depgraph contains two references to the model sldemo_mdlref_F2C.

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 unfilled triangles in their corners. For example, the following diagram indicates that one of the references to sldemo_mdlref_F2C operates in normal mode; the other, in accelerated mode.

Boxes representing protected referenced models have a lock icon, and the model name has the .slxp extension. Protected referenced model boxes have no expand(+)/collapse(–) button.

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, the following dependency instance view indicates that the model named rtwdemo_pil_component runs in processor-in-the-loop mode.

Warning Icon

An instance view displays warning icons on instance boxes to indicate that a reference is configured to run in Normal mode actually runs in Accelerated mode because it is directly or indirectly referenced by another model reference that runs in Accelerated mode.

The warning icon is a yellow triangle .

Opening the Model Dependency Viewer

The Model Dependency Viewer displays a graph of all the models and libraries referenced directly or indirectly by the model. You can use the dependency viewer to quickly find and open referenced libraries and models.

To display a dependency view for a model:

  1. Open the model.

  2. Select Analysis > Model Dependencies > Model Dependency Viewer, then select the type of view you want to see:

    • Models & Libraries

    • Models Only

    • Referenced Model Instances

    The Model Dependency Viewer appears, displaying a dependency view of the model.

Manipulating a Dependency View

The Model Dependency Viewer allows you to manipulate dependency views in various ways. See the following topics for more information:

Changing Dependency View Type

You can change the type of dependency view displayed in the viewer.

To change the type of dependency view, in the Model Dependency Viewer:

Excluding Block Libraries from a File Dependency View

By default a file dependency view includes libraries on which a model depends.

To exclude block libraries:

  • Deselect View > Include Libraries.

Including Simulink Blocksets in a File Dependency View

By default, a file dependency view omits MathWorks® block libraries when View > Include Libraries is selected.

To include libraries supplied by MathWorks:

  • Select View > Show MathWorks Dependencies.

Changing View Orientation

By default the orientation of the dependency graph displayed in the viewer is vertical.

To change the orientation to horizontal:

  • Select View > Orientation > Horizontal.

Expanding or Collapsing Views

You can expand or collapse each model or library in the dependency view to display or hide the dependencies for that model or library.

To expand or collapse views:

  • Click the expand(+)/collapse(-) button on the box representing the model or library to expand or collapse that view.

Zooming a Dependency View

You can enlarge or reduce the size of the dependency graph displayed in the viewer.

To zoom a dependency view in or out, do either of the following:

  • Press and hold down the spacebar key and then press the + or - key on the keyboard.

  • Move the scroll wheel on your mouse forward or backward.

To fit the view to the viewer window:

  • Press and release the spacebar key.

Moving a Dependency View

You can move a dependency view to another location in the viewer window.

To move the dependency view:

  1. Move the cursor over the view.

  2. Press your keyboard's space bar and your mouse's left button simultaneously.

  3. Move the cursor to drag the view to another location.

Rearranging a Dependency View

You can rearrange a dependency view by moving the blocks representing models and libraries. This can make a complex view easier to read.

To move a block to another location:

  1. Select the block you want to move by clicking it.

  2. Drag and drop the block in the new location.

Displaying and Hiding a Dependency View's Legend

The dependency view can display a legend that identifies the model in the view and the date and time the view was created.

To display or hide a dependency view's legend:

  • Select View > Show Legend from the viewer's menu bar.

Displaying Full Paths of Referenced Model Instances

In an instance view (see Referenced Model Instances View) , you can display the full path of a model reference in a tooltip or in the box representing the reference.

To display the full path in a tooltip:

  • Move the cursor over the box representing the reference in the view.

    A tooltip appears, displaying the path displays the full path of the Model block corresponding to the instance.

To display full paths in the boxes representing the instances:

  • Select View > Show Full Path.

    Each box in the instance view now displays the path of the Model block corresponding to the instance. The name of the referenced model appears in parentheses as illustrated in the following figure.

Refreshing a Dependency View

After changing a model displayed in a dependency view or any of its dependencies, you must update the view to reflect any dependency changes.

To update the view:

  • Select View > Refresh from the dependency viewer's menu bar.

Browsing Dependencies

You can use a dependency view to browse a model's dependencies:

  • To open a model or library displayed in the view, double-click its block.

  • To display the Model block corresponding to an instance in an instance view, right-click the instance and select Highlight Block from the menu that appears.

  • To open all models displayed in the view, select File > Open All Models from the viewer's menu bar.

  • To save all models displayed in the view, select File > Save All Models.

  • To close all models displayed in the view, select File > Close All Models.

Saving a Dependency View

You can save a dependency view for later viewing.

To save the current view:

  • Select File > Save As from the viewer's menu bar, then enter a name for the view.

To reopen the view:

  • Select File > Open from any viewer's menu bar, then select the view you want to open.

Printing a Dependency View

To print a dependency view:

  • Select File > Print from the dependency viewer's menu bar.

Was this topic helpful?