Preserve Variable Names when using Embedded Coder
Show older comments
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!
Answers (1)
Omair
on 20 Oct 2023
1 vote
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.
Categories
Find more on Texas Instruments C2000 Processors in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!