フィルターのクリア

Linking simulink blocks using code

3 ビュー (過去 30 日間)
Yessine KAMMOUN
Yessine KAMMOUN 2021 年 4 月 14 日
回答済み: Thomas Jensen 2021 年 4 月 14 日
Hi,
I have a simulink diagram that uses a duplicated simulink blocks. Is there a solution not to link these blocks manually? Is there a way to link blocks using matlab code?
Thx,

採用された回答

Thomas Jensen
Thomas Jensen 2021 年 4 月 14 日
Hi Yessine,
Yes, you can do it by script:
1- Get the port handle of both blocks
portHandles1 = get_param('model/block1','PortHandles');
portHandles2 = get_param('model/block2','PortHandles');
2- Add a line connecting the outport of one block to the outport of the other block
add_line('model',portHandles1.Outport,portHandles2.Inport);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePhysical Units についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by