フィルターのクリア

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 Center および File ExchangeSimulink Coder についてさらに検索

製品


リリース

R2013b

Community Treasure Hunt

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

Start Hunting!

Translated by