Error "Accelerator mode is not supported through the S-Function API" when calling set_param in Accelerator mode.
조회 수: 10 (최근 30일)
이전 댓글 표시
MathWorks Support Team
2020년 4월 15일
답변: MathWorks Support Team
2020년 4월 15일
I have a model open in accelerator mode. When I call 'set_param' to change the values of several model parameters, I get the following confusing error:
>> set_param(vdp,'StopTime','100')
Accelerator mode is not supported through the S-Function API
Why is this? How can I fix this?
채택된 답변
MathWorks Support Team
2020년 4월 15일
This error message is misleading, but there is a syntax error in the call to 'set_param' used here. The object input argument is supposed to be passed in as a string, character array, or handle to the object being modified.
In this case, passing in vdp (without quotes) is invalid because vdp is not evaluated correctly by set_param. Instead, pass in the name of the model in single quotes. The correct syntax is as follows:
>> set_param('vdp','StopTime','100')
If you change the model back to Normal mode then re-run the original command without quotes, the error message becomes more clear:
>> set_param(vdp,'StopTime','100')
Warning: Non-scalar data in first argument to set_param is detected.
Only first handle in the matrix is processed.
Invalid Simulink object handle
An enhancement request has been filed with the development team to improve the clarity of this error message for this scenario in Accelerator mode.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Component-Based Modeling에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!