How can I prevent MATLAB Coder from truncating the variable names in generated code?
Show older comments
I am using MATLAB Coder to convert MATLAB Code to C Code. In the generated code, MATLAB Coder truncates the names of any global variables that are longer than 30 characters. Additionally, MATLAB adds identifiers like "c_*", or "d_"*" to the start of variables to distinguish ones that become the same after truncation. As a result, I am no longer able to differentiate between the variables without searching through the code. For example, suppose I have the following variables in my MATLAB code:
global this_is_a_very_long_variable_name
global this_is_a_very_long_variable_name_to_use
After MATLAB Coder conversion, these variables have the following names in the generated C code
c_this_is_a_very_long_variable_
d_this_is_a_very_long_variable_
Is there a way to avoid truncating the variable names in MATLAB Coder?
Accepted Answer
More Answers (0)
Categories
Find more on Algorithm Design Basics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!