Model Reference Conversion Advisor
Convert subsystems to referenced models
Description
The Model Reference Conversion Advisor converts subsystems to referenced models. The advisor can convert a variety of subsystems, including conditional, masked, and referenced subsystems.
Converting subsystems to referenced models is beneficial for modeling large, complex systems and for team-based development. Many large models use a combination of subsystems and referenced models. To decide whether to convert a subsystem to a referenced model, see Explore Types of Model Components.
When the conversion encounters an issue, the Model Reference Conversion Advisor helps you review and fix the issue. Preparing the contents of a Subsystem block can eliminate or reduce the number of issues. Addressing these issues in the model editing environment can be more efficient than switching repeatedly between the Model Reference Conversion Advisor and the Simulink® Editor. For more information, see Convert Subsystems to Referenced Models.
Open the Model Reference Conversion Advisor
Simulink Editor: Select a Subsystem block. Then, in the Simulink Toolstrip, on the Subsystem Block tab, select Convert > Referenced Model.
MATLAB® Command Window: Use the
Simulink.SubSystem.convertToModelReference
function withUseConversionAdvisor
set totrue
.
Parameters
Programmatic Use
Limitations
The Model Reference Conversion Advisor does not support conversion for some types of subsystems. For example:
Subsystem blocks with Simscape™ Multibody™ components that cross the subsystem boundary
Asynchronous subsystems — To convert asynchronous subsystems to referenced models that accept asynchronous function calls, see Asynchronous Support Limitations (Simulink Coder).
Tips
To convert one or more subsystems to models, use the Simulink.SubSystem.convertToModelReference
function.
To generate a conversion summary report, use the Model Reference Conversion
Advisor.
This table provides a mapping between the Model Reference Conversion
Advisor parameters and the corresponding
Simulink.SubSystem.convertToModelReference
function
arguments.
Tool Parameter | Function Argument |
---|---|
New model name | To specify one or more model names, use the second input argument of the function. |
Conversion data file name | DataFileName |
Fix errors automatically (if possible) | AutoFix |
Replace the content of a subsystem with a Model block | ReplaceSubsystem |
Copy code mappings | CopyCodeMappings |
Model block simulation mode | SimulationModes |
Check simulation results after conversion | CheckSimulationResults |
Stop time | StopTime |
Absolute tolerance | AbsoluteTolerance |
Relative tolerance | RelativeTolerance |