Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

How do I do this data conversion in both Matlab and Simulink?

1 visualización (últimos 30 días)
Christian
Christian el 28 de Jun. de 2013
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
I need some help with converting a variable in matlab to fixed point.
I have a variable that should start from 0 and step up in increments of 0.03 to at least 300, preferably even higher than that. I also want it to take up as little resources as possible. I have tried:
x=fi(0,0,16,0.03,0,'SumMode','SpecifyPrecision','SumWordLength',28,'SumFractionLength',19);
y = fi(0.03,0,16,0.03,0,'SumMode','SpecifyPrecision','SumWordLength',28,'SumFractionlength',19);
and then looping:
x = x + y;
Then I get to 300 in 10,000 steps which is what I want. But as you can see I need a SumWordLength of 28 to achieve this...
I have som trouble to achieve this conversion in a simlink data conversion block too. Does anyone know of a way to make the variable a bit more 'lean' but still be able to convert to the same format using a simulink data conversion block?

Respuestas (0)

La pregunta está cerrada.

Community Treasure Hunt

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

Start Hunting!

Translated by