How to use Mask parameters in InitFcn
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Golden
am 9 Apr. 2020
Bearbeitet: Golden
am 16 Apr. 2020
I am using 2017a. I have a need to use a parameter from the mask of a block in the block property's InitFcn function. Is it possible? I have attached the model so you may see what I mean. Thank you.
0 Kommentare
Akzeptierte Antwort
Guru Mohanty
am 14 Apr. 2020
You Can access the block parameters of masked subsystem using get_param and change the block parameter using set_param.
You can make these changes inside InitFcn function.
% To get the Block Parameter
Param= get_param([gcs,'/Subsystem'],'Tend');
% To set Block parameter
set_param([gcs,'/Subsystem'],'Tend','6');
I have attached the modified Simulink Model.
1 Kommentar
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Author Block Masks finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!