How to change the parameter value of multiple (same) modules in Simulink?
1 次查看(过去 30 天)
显示 更早的评论
I have more than a hundred of same battery modules on a project. Now I want to change the spec of all the battery.
Is there an easy way to do this other than to delete and redo everything again.
0 个评论
回答(1 个)
Fangjun Jiang
2018-8-23
Usually, write a script to do it in a batch, using the following functions.
find_system()
get_param()
set_param()
2 个评论
Fangjun Jiang
2018-8-23
f14;
GainBlocks=find_system('f14','BlockType','Gain');
for k=1:numel(GainBlocks)
set_param(GainBlocks{k},'BackgroundColor','red');
end
web(fullfile(docroot, 'simulink/ug/approach-modeling-programmatically.html#butuhsj-1'))
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Programmatic Model Editing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!