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?

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

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?

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 MATLAB Coder에 대해 자세히 알아보기

제품

태그

질문:

2018년 3월 2일

편집:

2018년 3월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by