Azzera filtri
Azzera filtri

Simulink Code Generation Problem

8 visualizzazioni (ultimi 30 giorni)
Eray Dogan
Eray Dogan il 17 Ott 2019
Risposto: Atharva il 10 Ago 2023
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?

Risposte (1)

Atharva
Atharva il 10 Ago 2023
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.

Categorie

Scopri di più su Simulink Coder in Help Center e File Exchange

Prodotti


Release

R2013b

Community Treasure Hunt

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

Start Hunting!

Translated by