Main Content

Reference Existing Models

A model becomes a referenced model when aModelblock in another model references it. Any model can function as a referenced model, and can continue to function as a separate model.

For a video explaining how to create model references, seeGetting Started with Model Referencing.

To reference an existing model in another model, follow these steps.

  1. If the folder containing the model you want to reference is not on the MATLAB®path, add the folder to the MATLAB path.

  2. In the referenced model, setTotal number of instances allowed per top modelto:

    • Oneto use the model at most once in a model hierarchy.

    • Multipleto use the model more than once in a model hierarchy. To reduce overhead, specifyMultipleonly when necessary.

    • Zeroto preclude referencing the model.

  3. Create an instance of theModelblock in the parent model. The new block is initially unresolved because it does not specify a referenced model.

  4. To open the Block Parameters dialog box, double-click theModelblock.

  5. Enter the name of the referenced model in theModel namefield. This name must contain fewer than 60 characters, exclusive of the.slxor.mdlsuffix.

  6. ClickOK. If the referenced model contains root-level inputs or outputs, theModelblock displays corresponding input and output ports.

  7. Use theModelblock ports to connect referenced model signals to ports in the parent model. SeeModel Reference Interface and Boundary.

Note

When aModelblock references another model, double-clicking theModelblock opens the referenced model in context. To open the Block Parameters dialog box for aModelblock, select theModelblock. In the Simulink®Toolstrip, on theModel Blocktab, clickBlock Parameters.

See Also

Blocks

Related Topics

External Websites