This is machine translation

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

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Reference Existing Models

A model becomes a referenced model when a Model block 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, see Getting 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, set Total number of instances allowed per top model to:

    • One to use the model at most once in a model hierarchy.

    • Multiple to use the model more than once in a model hierarchy. To reduce overhead, specify Multiple only when necessary.

    • Zero to preclude referencing the model.

  3. Create an instance of the Model block 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 the Model block.

  5. Enter the name of the referenced model in the Model name field. This name must contain fewer than 60 characters, exclusive of the .slx or .mdl suffix.

  6. Click OK. If the referenced model contains root-level inputs or outputs, the Model block displays corresponding input and output ports.

  7. Use the Model block ports to connect referenced model signals to ports in the parent model. See Model Reference Interface.

See Also


Related Examples

More About