필터 지우기
필터 지우기

Using set_param with Configuration Set Reference

조회 수: 7 (최근 30일)
Dave Walter
Dave Walter 2016년 7월 7일
댓글: Krishna Akella 2022년 10월 28일
I have a medium sized Simulink project using Configuration Reference to tie all the submodels (Model Reference) to one Configuration set. Is there a way to change the configuration parameters from the command line using set_param? I get the error:
A configuration set reference does not allow writing to parameters in the source configuration set

답변 (1개)

Tiago Grossinho
Tiago Grossinho 2017년 7월 18일
Hello,
You probably have your question answered 1 year later, but for reference, I found my answer in the following page:
Chapter " §Change Values in a Referenced Configuration Set". Indeed, if you " Get" the config set which corresponds to the active one in your model, the set_param operation will immediately set the value in the model. My example:
>> get_param('model_name','RTWCAPISignals')
ans =
on
>> cref=getConfigSet('model_name','Reference');
>> cset = cref.getRefConfigSet;
>> set_param(cset,'RTWCAPISignals','off');
>> get_param('model_name','RTWCAPISignals')
ans =
off
Hoping it may help someone in the future, or even myself when I forget it one day! :)
  댓글 수: 2
Gergely Takacs
Gergely Takacs 2022년 5월 9일
Thank you for the tip. Not entirely user friendly to figure this out:)
Krishna Akella
Krishna Akella 2022년 10월 28일
Thanks, it helped me today!

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by