Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

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

조회 수: 1 (최근 30일)
Christian
Christian 2013년 6월 28일
마감: MATLAB Answer Bot 2021년 8월 20일
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?

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by