How do I programmatically set the parameters of a Simulink-PS Converter?
2 次查看(过去 30 天)
显示 更早的评论
I've got a program that generates a user-defined number of subsystems, each of which contains 1 Simulink-PS converter. I need the converters to have its Input Signal Unit dropdown equial to 'rad' and its Filtering and derivatives equal to 'Zero derivatives (pieceise constant)'. How can I go about this? The following does not work:
set_param(strcat(simFileName,'/','C_',num2str(i)), 'Units', 'rad','Filtering', 'Zero derivatives (piecewise constant)');
0 个评论
采纳的回答
Fangjun Jiang
2020-1-24
Click one such block in your model and run "get(gcbh)" in Command Window to learn about its properties and values.
You could do the change for all the same type of blocks in one shot
blks=find_system(bdroot,'FindAll','On','MaskType','Simulink-PS Converter')
set(blks,'Unit','rad','FilteringAndDerivatives','zero')
0 个评论
更多回答(1 个)
stozaki
2020-1-24
Hello Isaac,
I attached example model and script.
The set_param function can change the value of only one property in one execution.
Regards,
stozaki
2 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Applications 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!