Clear Filters
Clear Filters

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 view (last 30 days)
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 Comment
Ryan Livingston
Ryan Livingston on 23 Mar 2018
Edited: Ryan Livingston on 23 Mar 2018
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?

Sign in to comment.

Answers (1)

Tony Mohan Varghese
Tony Mohan Varghese on 22 Mar 2018

Categories

Find more on MATLAB 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!