How to programmatically create argin and argout ports in simulink function
10 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
A-Seong Joo
le 17 Oct 2022
Réponse apportée : pierre muratory
le 22 Juin 2023
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1159293/image.png)
0 commentaires
Réponse acceptée
Muthukumar Ganesan
le 25 Oct 2022
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
Plus de réponses (1)
pierre muratory
le 22 Juin 2023
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
0 commentaires
Voir également
Catégories
En savoir plus sur Interactive Model Editing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!