Preserve Variable Names when using Embedded Coder

10 次查看(过去 30 天)
Hello,
I am converting my Simulink Model to C code using Embedded Coder. Though, I am successfull in this process, I would like to know how do I preserve the variable names? The code generated has many random variables and when I try to map it with Simulink Model, it is too difficult to understand which variable belongs to what in the Simulink Model.
Looking forward to your response.
Thanks in advance!

回答(1 个)

Omair
Omair 2023-10-20
Hello,
You can control that by customizing the naming of identifiers on the Code Generation -> Identifiers pane in the model configuration parameters. Please take a look at the following links:
Furthermore, you may use storage classes for controlling model data representation in the generated code. Take a look at the following link:
Moreover, if you are working with one of the latest Matlab Versions, the 'Embedded Coder App' in Simulink offers a 'in-model code panel', where you can take a look at the generated code alongside your model. The code panel offers traceability between model and code, and vice versa.
Hope this helps!
Best,
Omair.

类别

Help CenterFile Exchange 中查找有关 Deployment, Integration, and Supported Hardware 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by