Matlab coder, fixed point conversion

Hello
i want to generate C code using Matlab coder with fixed point conversion.
My objective is to genereate C code with only Integer type
in the fixed point converter, proposed type can't be set with specific slope and bias values like this (T = numerictype(s,w,slope,bias))
Objective is to convert a programm which deals with double data (Matlab) in C code that deals with Integer data with a 10^5 resolution
ex : double input Data of 6.123456789 converted in the generated code in an Int32 input 612345
Any ideas ?

1 个评论

T = fi(6.123456789, 1, 32, 1e-5, 0); %signed 32 bit slope 1e-5
storedInteger(T) %-> uint32 612346
However I have not tried the Fixed Point Convertor

请先登录,再进行评论。

回答(1 个)

Hi Jerome,
Can you share a sample of MATLAB code with floating-point and expected integer type code from fixed-point converter? you can take the generated fixed-point MATLAB code from floating-point MATLAB and hand modify to suit your requirements. It woudl be useful to suggest alterates possible or consider future enhancements in the area.
Thanks

类别

帮助中心File Exchange 中查找有关 MATLAB Coder 的更多信息

产品

标签

Community Treasure Hunt

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

Start Hunting!

Translated by