Why do I get the error "Invalid setting in '<model>/<block>' for parameter '<param>'." when calling set_param?

Why do I get the error "Invalid setting in '<model>/<block>' for parameter '<param>'." when calling set_param using the following line of code?
>> set_param('my_model/Constant', 'Value', 0);

 채택된 답변

When using set_param for the "Value" field of a Constant block, use a character array instead of a double, which is evaluated to the actual value.
This is true of many parameters on other blocks as well.
This is fixed by making the following modification:
>> set_param('my_model/Constant', 'Value', '0');
Note that the 0 is enclosed in single quotes, making it a character array.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Modeling에 대해 자세히 알아보기

제품

릴리스

R2017b

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by