Why does Embedded Coder preserve my tunable parameter inside TAN but not TAND?
3 views (last 30 days)
Show older comments
I am generating code from a Simulink model in R2015a using the Embedded Coder target. I have a workspace variable a that is used in the model. I inline the rest of my values, but declare a as a SimulinkGlobal storage type so that it is not inlined in the generated code.
Where a is used in a constant or gain block, the parameter appears in the code. But if the constant or gain block has a value of tand(a), the numeric value of the expression is inlined in the code. This behavior does not occur if I instead use tan(a*pi/180).
It seems Simulink knows how to generate code for tan(a*pi/180) but not tand(a) and so defers to MATLAB to produce the numeric value, which Simulink then inlines.
Is this expected behavior? I see tand on the list of supported functions for code generation ( docsearch code generation supported functions ) and I would have thought that meant it was safe to use this way. Is there a different list of functions that support tunable parameters?
0 Comments
Answers (0)
See Also
Categories
Find more on Simulink Coder 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!