How to use Mask parameters in InitFcn
10 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Guru Mohanty
2020-4-14
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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Author Block Masks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!