필터 지우기
필터 지우기

How to change the parameter value of multiple (same) modules in Simulink?

조회 수: 1 (최근 30일)
Anh Tran
Anh Tran 2018년 8월 23일
댓글: Fangjun Jiang 2018년 8월 23일
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.

답변 (1개)

Fangjun Jiang
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
Anh Tran
Anh Tran 2018년 8월 23일
Can you give me a specific example (or a link to a tutorial) to do this? I'm quite new to Simulink.
Fangjun Jiang
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 CenterFile Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by