フィルターのクリア

How to programmatically create argin and argout ports in simulink function

12 ビュー (過去 30 日間)
A-Seong Joo
A-Seong Joo 2022 年 10 月 17 日
回答済み: pierre muratory 2023 年 6 月 22 日
Hello.
I want to create argin and argout inside simulink function using command like add_block.
For example, I want to make u1, u2, y1, y2 using code as shown in the screenshot below.
Please check.
Thank you.

採用された回答

Muthukumar Ganesan
Muthukumar Ganesan 2022 年 10 月 25 日
Hi,
Arg In and Arg Out blocks will not be present in simulink library browser. Hence add_block cannot refer to the this block from simulink browser, instead you can refer to the arg input/output blocks present inside the simulink function.
For Example, I have a simulink function with input and output args as u and y respectively
add_block('untitled/Simulink Function/u','untitled/Simulink Function/u1'); % To create new Arg Ins
add_block('untitled/Simulink Function/y','untitled/Simulink Function/y1'); % To create new Arg Outs

その他の回答 (1 件)

pierre muratory
pierre muratory 2023 年 6 月 22 日
It doesn't look to work on R2022B :
add_block('untitled/Simulink Function/u','untitled/Simulink Function/u1');
There is no block named 'untitled/Simulink Function/u'
could you please tell us how to do it ?
thanks

カテゴリ

Help Center および File ExchangeInteractive Model Editing についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by