Documentation

Simulink.BlockDiagram.expandSubsystem

Expand subsystem contents to containing model level

Syntax

Simulink.BlockDiagram.expandSubsystem(block)

Description

Simulink.BlockDiagram.expandSubsystem(block) expands the contents of the subsystem for the specified Subsystem block. Subsystem expansion involves moving the contents of a virtual subsystem into the system that contains that subsystem.

You can expand virtual subsystems that are not masked, linked, or commented. For details, see Subsystems That You Can Expand.

Input Arguments

block

A character vector that specifies one of the following:

  • The path to a subsystem block in a loaded model.

  • The block handle of a subsystem block in a loaded model.

  • gcb (the currently selected block)

Examples

The following function expands the Combustion subsystem.

open_system('sldemo_enginewc')
Simulink.BlockDiagram.expandSubsystem('sldemo_enginewc/Combustion')

The blocks and signals that were in the Combustion subsystem become part of the top-level model that contained the Combustion subsystem, replacing that Subsystem block.

Introduced in R2014a

Was this topic helpful?