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 Commento

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

Accedi per commentare.

Risposte (1)

Kiran Kintali
Kiran Kintali il 5 Giu 2020

0 voti

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

Categorie

Scopri di più su MATLAB Coder in Centro assistenza e File Exchange

Prodotti

Richiesto:

il 2 Giu 2020

Community Treasure Hunt

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

Start Hunting!

Translated by