Matlab Coder to target specific hardware
Ältere Kommentare anzeigen
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.
Antworten (1)
Kaustubha Govind
am 29 Mär. 2012
0 Stimmen
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.
Kategorien
Mehr zu MATLAB Coder finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!