This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Model Referencing

Reuse models as blocks in other models

You can include one model in another by using a Model block, which represents a reference to another model, called a referenced model. For simulation and code generation, the referenced model effectively replaces the Model block that references it. The model that contains a referenced model is its parent model. A collection of parent and referenced models constitutes a model reference hierarchy.

You can organize large models hierarchically, similar to using subsystems. Like libraries, referenced models allow you to use the same capability repeatedly without having to redefine it. Referenced models provide several advantages that are unavailable with subsystems and/or library blocks. Several of these advantages result from Simulink® compiling a referenced model independent of the context of the referenced model, including:

  • Modular development

  • Inclusion by reference

  • Incremental loading

  • Accelerated simulation

  • Incremental code generation

  • Independent configuration sets

To get started using model referencing, see Overview of Model Referencing.


Model Include multiple model implementations as block in another model


find_mdlrefs Find Model blocks and referenced models at all levels or at top level only
view_mdlrefs Display graph of model reference dependencies
Simulink.SubSystem.convertToModelReference Convert subsystem to model reference
slbuild Build standalone executable or model reference target for model; except where noted, this function requires a Simulink Coder license


Determine When to Use Model Referencing

Overview of Model Referencing

You can include one model in another by using Model blocks.

When to Use Model Referencing

Determine when to use model referencing to meet your modeling requirements.

Simulink Model Referencing Requirements

Configure a model for use in a model reference hierarchy.

Model Referencing Limitations

Model referencing has some limitations relating to features such as simulation modes, masking, and debugging.

Create Referenced Models

Create a Referenced Model

Use a Model block to reference another model, using Inport and Outport blocks for the interface.

Subsystem to Referenced Model Conversion

Determine when to convert a subsystem to a referenced model and select the appropriate options for the conversion.

Convert a Subsystem to a Referenced Model

Use the Model Reference Conversion Advisor or Simulink.Subsystem.convertToModelReference function to convert subsystems to referenced models.

Refresh Model Blocks

Refresh a Model block to update its internal representation so that it reflects changes in the interface of the model that it references.

View a Model Referencing Hierarchy

Examine a model reference hierarchy.

Preview Content of Hierarchical Items

Display representation of block contents on the face of a block

Parameterize Instances of a Reusable Referenced Model

When you model a reusable component as a referenced model, to configure each instance of the component to use different values for block parameters, create model arguments.

Create and Reference Conditional Referenced Models

Execute referenced models conditionally, similarly to how you can execute conditional subsystems.

Use Referenced Models in a Model

Buses in Referenced Models

To have bus data cross model reference boundaries, use a bus object (Simulink.Bus) to define the bus.

Signal Logging in Referenced Models

In a referenced model, you can log any signal configured for signal logging. You can override signal logging settings in referenced models.

S-Functions with Referenced Models

Use S-functions with model referencing.

Simulate Referenced Models

Sample Times for Model Referencing

A referenced model can inherit sample times from the model that references it.

Simulate Model Referencing Models

Select the simulation mode for simulating models in a model reference hierarchy.

Model Referencing Simulation Targets

A simulation target, or SIM target, is a MEX-file that implements a referenced model that executes in accelerator mode.

Reuse Simulation Builds for Faster Simulations

Use Simulink cache files to share referenced model build artifacts without repeating the cost of a first-time build.

Simulate Models with Multiple Referenced Model Instances

Simulate a model that contains multiple instances of a referenced model.

Simulate Conditional Referenced Models

Simulate conditional referenced models.

Protected Models

Protected Model

Use a protected model to share a model without revealing its intellectual property.

Use Protected Model in Simulation

Use a protected model, which you can include in a protected model package.

Was this topic helpful?