Variable name not coming properly in the generated code

1 view (last 30 days)
Hi,
I have generated code from the simulink model(2011b matlab )
My simulink model contains embedded matlab function where i have some algorithm implemented which is using some of the local variables defined
For e.g abc = single(0.0)
so in the generated code it is coming as real32_T abc;
This is okay
but when i am changing the varaiable name say
abc_f32 = single(0.0)
it is coming as real32_T abc_f;
not correct
when i am changing to abc_f32f = single(0.0)
it is coming as real32_T abc_f32f;
Why this strange behaviour any idea????
Please help me to solve this problem??
Please Suggest me any solution.

Answers (1)

Geoff
Geoff on 6 Mar 2012
Does it happen when you have other numeric suffices on your variable names? ie if you have the variable 'abc_f31' or 'abc_f33'?
If other suffices work but 32 does not, then I would say they have explicitly prevented that value to avoid name clashes.
The suggested solution, of course, is to not use variable names that end with numbers. =)

Categories

Find more on Deployment, Integration, and Supported Hardware 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!