How do I programmatically set the parameters of a Simulink-PS Converter?

조회 수: 5 (최근 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)');

채택된 답변

Fangjun Jiang
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')

추가 답변 (1개)

stozaki
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
Fangjun Jiang
Fangjun Jiang 2020년 1월 24일
set_param() can set multiple properties in one shot.
help set_param
stozaki
stozaki 2020년 1월 24일
I am sorry. It is misstake.
It simply changed your property name.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Applications에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by