Main Content

Referenced Files Pane

View, save, and close referenced subsystems and models

Since R2020b

Description

The Referenced Files pane allows you to view, save, and close referenced subsystems and models in the corresponding model hierarchy.

The Referenced Files pane shows a flat list of model and subsystem files that are loaded and referenced by the model hierarchy. Opening the top model in the model hierarchy does not load the referenced models in the model hierarchy. Load referenced models by opening them in the Simulink® Editor or by using a function such as load_system. Referenced subsystems load when you load the models that reference them.

When you save a model using the Referenced Files pane, you also save the models it references. When you close a model using the Referenced Files pane, you also close the models it references that are not open in another model hierarchy. Before you can close a modified model, you must choose whether to save the corresponding changes, which include changes to the model workspace.

The Referenced Files pane lists referenced files, such as models, that are loaded.

Open the Referenced Files Pane

  • On the Modeling tab, in the Design gallery, click Referenced Files.

  • If a referenced file in the model hierarchy has been modified, on the Simulation tab, click the Save All button arrow, then click Save Referenced Files > Manage Referenced Files.

  • Navigate into a referenced model in the model hierarchy. The Referenced Files pane opens as a tab on the left side of the Simulink Editor unless you have previously hidden the pane.

Examples

expand all

Save and discard changes to individual referenced models in a model hierarchy.

Open the ModelReferenceHierarchy project.

openProject("ModelReferenceHierarchy");

At startup, the ModelReferenceHierarchy project opens the sldemo_mdlref_depgraph model, which is the top model in a model hierarchy.

On the Simulink Toolstrip Modeling tab, in the Design gallery, click Referenced Files.

The Referenced Files pane opens. It does not show any referenced subsystems or models. The sldemo_mdlref_depgraph model does not reference any subsystems, but it references multiple models. The referenced models must be loaded to appear in the Referenced Files pane.

Double-click the block named thermostat.

The sldemo_mdlref_heater model loads and opens. When Show Only Modified Files in the Filter contents list () is cleared, this model appears in the Referenced Files pane. Otherwise, you must modify the file before it appears.

Modify sldemo_mdlref_heater by moving a block.

Next to the model name, the dirty flag (*) indicates that the model has unsaved changes.

Double-click the block named Fahrenheit to Celsius.

The sldemo_mdlref_F2C model loads and opens.

Modify sldemo_mdlref_F2C by moving a block.

Next to the model name, the dirty flag (*) indicates that the model has unsaved changes.

Suppose you want to keep your changes to sldemo_mdlref_F2C, and you want to discard your changes to sldemo_mdlref_heater.

If you select sldemo_mdlref_heater and click Close, you receive a message asking whether to save the changes to sldemo_mdlref_heater and sldemo_mdlref_F2C before closing both models. Unless a referenced model is open in another model hierarchy, closing its parent model closes the referenced model.

To keep your changes to sldemo_mdlref_F2C, select it in the Referenced Files pane and click Save. Then, select sldemo_mdlref_heater and click Close.

Version History

Introduced in R2020b