Documentation

Expand Subsystem Contents

Expand a subsystem to flatten a model hierarchy by bringing the contents of a subsystem up one level.

Expand a Subsystem

  1. In the Simulink®Editor, right-click the Subsystem block for the subsystem that you want to expand.

  2. From the context menu, selectSubsystem & Model Reference>Expand Subsystem.

    Expand Subsystemis disabled for subsystems that you cannot convert. For some kinds of subsystems, you have the option of having Simulink modify the subsystem so that you can then expand it. For details, seeSubsystems That You Can Automatically Modify to Enable Expansion.

  3. If necessary, modify the model layout for readability.

    Simulink distributes blocks and routes signals for readability, but you can refine the model layout to enhance readability. Also, you may want to modify the model to adjust for how the subsystem expansion handles aspects of the model such as signal naming. For details, seeResults of Expanding a Subsystem.

  4. Update scripts and test harnesses that rely on the hierarchical paths to blocks that were in the subsystem that you expanded.

Nested Subsystems

Subsystem expansion applies to the currently selected subsystem level. Simulink does not expand other subsystems in a nested subsystem hierarchy.

To improve readability when you expand nested subsystems, start by expanding the highest-level subsystem that you want to expand, and then work your way down the hierarchy as far as you want to expand.

扩大通讯的一个子系统and Line

To expand a subsystem programmatically, use theSimulink.BlockDiagram.expandSubsystemfunction.

Related Topics

Was this topic helpful?