Using Simulink Previous page   Next Page

Referencing Models

Simulink allows you to include models in other models as blocks, a feature called model referencing. You create references to other models by creating instances of Model blocks in a parent model (see Creating a Model Reference). Each instance of a Model block in a parent model represents a reference to another model called a referenced model. A Model block displays inputs and outputs corresponding to the root-level inputs and outputs of the model it references, enabling you to incorporate the referenced model into the block diagram of the parent model.

During simulation, Simulink invokes an automatically generated S-function, called the referenced model's simulation target, to compute the Model block's outputs as needed. If the simulation target does not exist at the beginning of a simulation, Simulink generates it from the referenced model. If the simulation target does exist, Simulink checks whether the referenced model has changed significantly since the target was last generated. If so, Simulink regenerates the target to reflect the changes to the referenced model (see Building Simulation Targets for more information).

A referenced model can itself reference other models. The topmost model in a hierarchy of model references is called the root model. A parent model can contain multiple references to the same model as long as the referenced model does not define global data. You can parameterize model references such that each reference to a model can specify different values for variables that define the model's behavior (see Parameterizing Model References for more information).

Simulink includes a set of demos that illustrate various aspects of model referencing. To run the demos from the MATLAB command line, enter


Previous page  Conditional Execution Behavior Model Referencing Versus Subsystems Next page

© 1994-2005 The MathWorks, Inc.