Why does C code generated by MATLAB Coder have numerical values already assigned to some internal variables of functions while the original MATLAB user defined function requires user input for those variables?

1 次查看(过去 30 天)
I am using MATLAB Coder to generate C code. The original MATLAB user defined function has some variables that should be assigned values by the user. On the other hand I find the generated C code has already values assigned and the operations within the function are performed using those fixed numerical values in place of variables. These numerical values are on the basis of the example inputs I provide while using the MATLAB Coder GUI.
  1 个评论
Ryan Livingston
Ryan Livingston 2018-3-23
编辑:Ryan Livingston 2018-3-23
It sounds like you may have defined the inputs to be constants. The way you would accomplish this in the Coder App is by clicking the Define Constant link described here and shown here.
You may also be using coder.Constant. Are any of those true? If not, can you please describe how you are specifying your input types?

请先登录,再进行评论。

回答(1 个)

Tony Mohan Varghese

类别

Help CenterFile Exchange 中查找有关 MATLAB Coder 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by