필터 지우기
필터 지우기

Simulink Code Generation Problem

조회 수: 8 (최근 30일)
Eray Dogan
Eray Dogan 2019년 10월 17일
답변: Atharva 2023년 8월 10일
Hi,
I am using a Matlab Function block in my simulink model. In that matlab function block i am using some local parameters without making extra definition for them.
When I generate a C code over my simulink model and check C code, I realize that matlab gives random different parameter names to those that I use in my matlab function locally.
Is there a reason for that?
How I can solve this problem?
Is there any setting in Configuration Parameter section to fix this?

답변 (1개)

Atharva
Atharva 2023년 8월 10일
Hi Eray,
When generating C code from a Simulink model that includes a MATLAB Function block, the code generation process may rename local parameters used within the MATLAB Function block. This behavior is expected and is done to ensure the generated C code is valid and does not conflict with any existing variable names.
If you have any concerns about the renaming of parameters or if it is causing issues with your code, you can consider using input and output arguments for your MATLAB Function block instead of relying on local parameters. This will case the parameter names to be preserved in the generated code.

카테고리

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

제품


릴리스

R2013b

Community Treasure Hunt

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

Start Hunting!

Translated by