필터 지우기
필터 지우기

Alternate of set_param in simulink compatible with C coder.

조회 수: 1 (최근 30일)
daud rind
daud rind 2021년 10월 15일
편집: Ayush 2024년 6월 19일
Hi!
Hope you all are having a productive day.
My question is that i want to update parameters of a block but cannot use set_param because it is not Embedded Coder(C/C++) supported.
Is there any alternate to set_param in simulink compaqtible with Embedded coder.

답변 (1개)

Ayush
Ayush 2024년 6월 19일
편집: Ayush 2024년 6월 19일
Hi Daud,
You can try leveraging the “coder.extrinsic” function if you want to update the parameters of a block using the “set_param” function even though it is not supported by Embedded Coder (C/C++).
The function does not produce code for the body of the extrinsic function, in this case "set_param" function and instead uses the MATLAB engine to execute this call. Please refer to the below documentation to know more about “coder.extrinsic”:
Here is an example code for your reference:
% Add thie line before declaring/calling set_param in your script.
coder.extrinsic('set_param')
Hope this helps!

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by