Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

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

1 vue (au cours des 30 derniers jours)
Christian
Christian le 28 Juin 2013
Clôturé : MATLAB Answer Bot le 20 Août 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?

Réponses (0)

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by