Effacer les filtres
Effacer les filtres

Simulink Code Generation Problem

8 vues (au cours des 30 derniers jours)
Eray Dogan
Eray Dogan le 17 Oct 2019
Réponse apportée : Atharva le 10 Août 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?

Réponses (1)

Atharva
Atharva le 10 Août 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.

Catégories

En savoir plus sur Simulink Coder dans Help Center et File Exchange

Produits


Version

R2013b

Community Treasure Hunt

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

Start Hunting!

Translated by