メインコンテンツ

Simulink.BlockDiagram.arrangeSystem

ブロック線図のレイアウトを改良

説明

Simulink.BlockDiagram.arrangeSystem(bd) は、ブロックの再配置、サイズ変更、移動を行ったり、信号線をまっすぐにすることで、指定されたブロック線図のレイアウトを改良します。

メモ

いずれの構文でも、Simulink.BlockDiagram.arrangeSystem 関数を実行するとライン ハンドルが変わります。

Simulink.BlockDiagram.arrangeSystem(bd,FullLayout=tf) は、レイアウトを自動化しても元のレイアウトが改善されない可能性がある場合でも自動レイアウトを適用するかどうかを指定します。

すべて折りたたむ

開いている任意のモデルで Simulink.BlockDiagram.arrangeSystem を使用できます。特に、プログラムによって入力するモデルで役立ちます。

モデル ex_arrange_system のブロックは適切に配置されていません。

open_system('ex_arrange_system')

The model contains a Sine Wave block, a Pulse block, a Subsystem block, and a Scope block. The Scope block is on top of the Subsystem block, and none of the blocks are lined up. The Sine Wave and Pulse blocks connect to the Subsystem block, and the Subsystem block connects to the Scope block. The blocks are connected with diagonal signal lines. Two of the signal lines overlap.

そのサブシステムのブロックも適切に配置されていません。

open_system('ex_arrange_system/Subsystem')

The subsystem contains two input port blocks, a Sum block, and an output port block. None of the blocks are lined up. The two input ports connect to the Sum block, and the Sum block connects to the output port block. The blocks are connected with diagonal signal lines. Two of the signal lines overlap.

指定されたシステムのトップ レイヤーにプログラムによってブロックを配置します。

Simulink.BlockDiagram.arrangeSystem('ex_arrange_system')

The blocks in the top layer of the model are neatly arranged, with the Sine Wave and Pulse blocks at the left, the Subsystem block in the middle, and the Scope block on the right. The connecting signal lines are exclusively composed of orthogonal line segments. No blocks or signal lines overlap.

Simulink.BlockDiagram.arrangeSystem('ex_arrange_system/Subsystem')

The blocks in the subsystem are neatly arranged, with the input port blocks blocks at the left, the Sum block in the middle, and the output port block on the right. The connecting signal lines are exclusively composed of orthogonal line segments. No blocks or signal lines overlap.

既定では、Simulink.BlockDiagram.arrangeSystem は、レイアウトを自動化すると元のレイアウトが改善されると予想される場合にのみ、自動レイアウトを適用します。レイアウトを自動化しても元のレイアウトが改善されない可能性がある場合でもレイアウトを適用するようこの関数に強制できます。

モデル ForceArrangeSystem のブロックは適切に配置されています。

open_system('ex_arrange_system2')

The model contains a Sine Wave block and a Pulse block that connect to a Subsystem block. The Subsystem block connects to a Scope block. The blocks are neatly arranged, with the Sine Wave and Pulse blocks at the left, the Subsystem in the middle, and the Scope block at the right. The blocks are connected with signal lines that consist exclusively of orthogonal line segments.

ブロックは既に適切に配置されているため、レイアウトを自動化しても元のレイアウトが改善されない可能性があります。

自動レイアウトによって改善されるかどうかに関係なく自動レイアウトを適用するとします。自動レイアウトを強制適用するには、FullLayouttrue に設定します。

Simulink.BlockDiagram.arrangeSystem('ex_arrange_system2',FullLayout='true')

The model has the same layout as before.

入力引数

すべて折りたたむ

システムのブロック線図。文字ベクトル、string スカラー、または数値スカラーとして指定します。

次のオプションのうちの 1 つを指定します。

  • システム名 (パスまたは拡張子を含めてはなりません)

  • システム ハンドル

  • Subsystem ブロック パス

データ型: double | char | string

自動レイアウトを強制適用するオプション。'true' または 'false' として指定します。

  • 'true' — レイアウトを自動化しても元のレイアウトが改善されない可能性がある場合でも、自動レイアウトを適用します。

  • 'false' — レイアウトを自動化すると元のレイアウトが改善されると予想される場合にのみ、自動レイアウトを適用します。

バージョン履歴

R2018a で導入