How to change the input of a subsystem using open_system
Afficher commentaires plus anciens
There are two blocks in the model I designed: MATLAB Function and testSub.

At this time, I would like to control the input of testSub using MATLAB Function.
So I designed the code as below.
function y = fcn(u)
coder.extrinsic("set_param");
coder.extrinsic("close_system");
coder.extrinsic("open_system");
set_param('untitled1/Subsystem/testSub','OpenFcn','');
open_system('untitled1/Subsystem/testSub','OpenFcn');
y=1;
I want to set input to 'u' in set_param, but is there any way?
help will be appreciated.
Thanx
2 commentaires
Angelo Yeo
le 22 Déc 2023
Can you describe the desired workflow? What do you want to do in the end?
eblee
le 25 Déc 2023
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Using MATLAB Projects in Simulink dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
