Matlab Coder to target specific hardware

1 view (last 30 days)
Hidayat
Hidayat on 29 Mar 2012
Hi,
I am currently testing Matlab Coder to generate C codes from Matlab codes to be used in an single precision floating point embedded processor. Therefore, I would like to eliminate all the 'double' data types generated by Matlab Coder without changing anything on the original Matlab Codes (typecast to single, etc)
In the Matlab Coder project settings, there is a tab for 'Hardware Implementation' settings, which I can specify the target hardware and also the largest atomic size for integer and floating-point. I have set the largest atomic size for floating-point to 'Float' but after the code generation is completed, there are no change in the C codes in terms of data types. It still creates plenty of double instead of limiting the floating point to a single precision 'float'.
Is there anything else that need to be done to make this option works (limit the data types size)?
Thanks.

Answers (1)

Kaustubha Govind
Kaustubha Govind on 29 Mar 2012
Does your function have any input arguments, if yes, do you use the codegen "-args" option to provide example inputs? If yes, have you tried specify those as having the 'single' datatype? I would expect that doing this will automatically convert intermediate and final datatypes to be all single.

Products

Community Treasure Hunt

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

Start Hunting!