| Simulink® | ![]() |
A model becomes a submodel when a Model block in some other model references it. Any model can function as a submodel, and such use does not preclude using it as a separate model also. To create a reference to a model (submodel) in another model (parent model):
If the directory containing the submodel to be referenced is not on the MATLAB® path, add the directory to the MATLAB path.
In the submodel:
Enable Configuration Parameters > Optimization > Inline parameters. You must enable Inline parameters for all models in a model reference hierarchy except the hierarchy's top model. See Inline Parameter Requirements for details.
Set Configuration Parameters > Model Referencing > Total number of instances allowed per top model to One if the model will be used at most once in any hierarchy, or to Multiple if it will be used more than once. To reduce overhead, specify Multiple only when necessary. You can also set the option to Zero, which precludes referencing the model.
Create an instance of the Model block in the parent model by dragging a Model block instance from the Ports & Subsystems library to the parent model. The new block is initially unresolved (specifies no submodel) and has the following appearance:

Open the new Model block's parameter dialog box by double-clicking the Model block. See Navigating a Model Block for more about accessing Model block parameters.

Enter the name of the submodel in the Model name field. This name must contain fewer than 60 characters. (See Name Length Requirement.)
For information about Model Arguments and Model argument values, see Using Model Arguments.
For information about the Simulation mode, see Referenced Model Simulation Modes.
If the referenced model contains any root-level inputs or outputs, Simulink® displays corresponding input and output ports on the Model block instance that you have created. Use these ports to connect the referenced model to other ports in the parent model. For information about connecting blocks in a parent model to a referenced model that has bus inputs or outputs, see Bus Usage Requirements.
![]() | Overview of Model Referencing | Converting a Subsystem to a Referenced Model | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |