Error in Using set_param
이전 댓글 표시
I've not been able to set the consant in the "constant" block. I used: set_param('dummy/Constant','x',50) but kept getting eroor "Constant block does not have a parameter named 'x'". 'dummy' is the model name.
Thanks.
채택된 답변
추가 답변 (1개)
Brian B
2014년 7월 14일
Try
set_param('dummy/Constant','Value','50')
Note that the value is also a string.
댓글 수: 4
William
2014년 7월 14일
Brian B
2014년 7월 14일
Can you post the exact command that you tried? If I run
set_param('untitled/Constant','Value',50)
I get the error you describe. If I replace 50 with '50', I do not get an error.
William
2014년 7월 15일
Fuli Wang
2019년 12월 13일
x=50;
set_param('untitled/Constant','Value',num2str(x));
카테고리
도움말 센터 및 File Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!