Products & Services Solutions Academia Support User Community Company

Learn more about Simulink   

Converting a Subsystem to a Referenced Model

You can convert any atomic subsystem to a referenced model. The conversion requires the model containing the subsystem to have the following configuration parameter settings:

After specifying the indicated parameter values, select Convert to Model Block from the subsystem's context menu. Simulink saves the contents of the subsystem as a new model, then creates and opens an untitled model that contains a Model block whose referenced model is the new model.

Simulink automatically provides a model name that is based on the block name and is unique in the MATLAB path. This name always contains fewer than 60 characters. If an error occurs during the conversion, the outcome depends on the error:

Even if conversion is successful, you may still need to reconfigure the resulting model to meet your requirements. For example, the Interpolate data parameter of each root input port in the new model is selected by default. You can clear the parameter wherever this default is not appropriate. See the Inport block documentation for information about Interpolate data.

Once you have successfully created a Model block and referenced model from a subsystem, you can delete the subsystem block from the source model and copy the Model block to the deleted subsystem block's location. All signals will automatically reconnect. The source model is now a parent model that contains the referenced model.

You can use Simulink.SubSystem.convertToModelReference to convert subsystems to model references programmatically. The function provides more capabilities than Convert to Model Block, such as the ability to replace a subsystem with an equivalent Model block in a single operation.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS