You can include one model in another by using a Model block. Each instance of a Model block is a model reference. For simulation and code generation, blocks within a referenced model execute together as a unit. The model that contains a referenced model is a parent model. A collection of parent and referenced models constitutes a model hierarchy.
Like subsystems, model references allow you to organize large models hierarchically. Like libraries, model references allow you to define a set of blocks once and use it repeatedly. Model references provide several advantages that are unavailable with subsystems and libraries. Several of these advantages result from referenced models compiling independent of the context of the Model block, including:
Inclusion by reference
Incremental code generation
Independent configuration sets
|Model||Include multiple model implementations as block in another model through model reference|
|Display graph of model referencing dependencies with or without library dependencies|
|Find Model blocks and referenced models at all levels or at top level only|
|Specify root folders for files generated by diagram updates and model builds|
|Convert subsystem to model reference|
|Build standalone executable or model reference target for model; except where noted, this function requires a Simulink Coder license|
Create a model hierarchy by referencing one model in another model. A referenced model contains blocks that execute together as a unit.
Model references have requirements and limitations relating to features such as reusability, simulation modes, masking, and debugging.
Organize your model into independently functional parts
Partition a design when it becomes too complex for one person to know all of the details.
Include a model in another model.
Use a protected model that you received from a third party.
Prepare a subsystem for conversion, convert the subsystem to a model, and compare simulation results before and after conversion.
Examine the contents, structure, model versions, and logged signals in a model hierarchy.
Ports in the referenced model correspond with ports at the model reference. Signals that cross the model boundary must meet certain requirements.
Execute referenced models conditionally, similar to conditional subsystems.
Configuration parameter values can be different in top models and referenced models. There are some configuration parameter values that have special requirements or behavior with model referencing.
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.
A referenced model can inherit sample times from the model that references it.
Select the simulation mode for simulating models in a model hierarchy.
A simulation target, or SIM target, is a MEX-file that implements a referenced model that executes in accelerator mode.
Use Simulink cache files to share referenced model build artifacts without repeating the cost of a first-time build.
Simulate a model that contains multiple instances of a referenced model.