| Simulink® | ![]() |
You can convert any atomic subsystem to a referenced model. The conversion requires that the model containing the subsystem have the following configuration parameter settings:
Configuration Parameters > Optimization > Inline parameters must be enabled.
Configuration Parameters > Diagnostics > Data Validity > Signal resolution must be Explicit only.
Configuration Parameters > Diagnostics > Connectivity > Mux blocks used to create bus signals must be Error.
After specifying the indicated parameter values, select Convert to Model Block from the subsystem's context menu. Simulink® does the following:
Saves the contents of the subsystem as a 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.
Creates and opens an untitled model that contains a Model block whose referenced model is the new model that contains the contents of the subsystem.
If an error occurs during the conversion, the result depends on the error:
For some errors, a message box appears that gives you the choice of cancelling or continuing.
If continuing is impossible, Simulink cancels the conversion without offering a choice to continue.
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 subsystem block's location. All signals will automatically reconnect. The source model is now a parent model that contains a 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. See the Simulink reference documentation for details.
![]() | Creating a Model Reference | Referenced Model Simulation Modes | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |