Why does Embedded Coder preserve my tunable parameter inside TAN but not TAND?

1 回表示 (過去 30 日間)
Robert
Robert 2016 年 4 月 12 日
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 件)

カテゴリ

Help Center および File ExchangeSimulink Coder についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by