メインコンテンツ

Simulink.BlockDiagram.expandSubsystem

サブシステムをサブシステムの内容で置き換える

説明

Simulink.BlockDiagram.expandSubsystem(subsys) は、指定されたサブシステムを、それを含むブロック線図の内容で置き換えます。サブシステムを含むファイルは開いているか、読み込まれていなければなりません。

展開できるのはマスク、リンク、コメントが設定されていないバーチャル サブシステムです。詳細については、展開できるサブシステムを参照してください。

Simulink.BlockDiagram.expandSubsystem(subsys,'CreateArea',specifier) は、展開されたサブシステムの内容の周りに領域が作成されないオプションを提供します。

すべて折りたたむ

サブシステムをその内容で置き換えます。

機能的に関連したブロックを分離するサブシステムを含むモデル例を開きます。

open_system('SubsystemExpansionModel')

The model contains a Subsystem block with three output ports. The output ports connect to a Sum block that connects to a Gain block that connects to an Integrator, Second-Order block. The Integrator, Second Order block has two output ports that connect to a Scope block and to the two input ports of the Subsystem.

サブシステムを展開します。

Simulink.BlockDiagram.expandSubsystem('SubsystemExpansionModel/Subsystem')

サブシステムの内容を含む領域が Subsystem ブロックに置き換えられます。

The Subsystem block in the model is replaced by an area with the label "Subsystem" that contains a Step block and two Gain blocks. The output ports of all three blocks connect to the Sum block outside the area. The input ports of the Gain blocks connect to the Scope block outside the area.

内容の周りに領域を作成せずに、サブシステムをその内容で置き換えます。

機能的に関連したブロックを分離するサブシステムを含むモデル例を開きます。

open_system('SubsystemExpansionModel')

The model contains a Subsystem block with three output ports. The output ports connect to a Sum block that connects to a Gain block that connects to an Integrator, Second-Order block. The Integrator, Second Order block has two output ports that connect to a Scope block and to the two input ports of the Subsystem.

サブシステムを展開します。

Simulink.BlockDiagram.expandSubsystem(...
    'SubsystemExpansionModel/Subsystem','CreateArea','Off')

サブシステムの内容が Subsystem ブロックに置き換えられます。

The Subsystem block in the model is replaced by a Step block and two Gain blocks. The output ports of all three blocks connect to the Sum block. The input ports of the Gain blocks connect to the Scope block.

入力引数

すべて折りたたむ

Subsystem ブロックのパスまたはハンドル。文字ベクトル、string スカラー、または数値スカラーとして指定します。

データ型: double | char | string

内容の周りに領域を作成するオプション。領域を作成する場合は 'on'、領域を作成しない場合は 'off' と指定します。

データ型: char | string

バージョン履歴

R2014a で導入