Error in dividing the data

1 次查看(过去 30 天)
I have two values from workspace
Cww=0
0
0
32
0
0
0
0
0
0
Eww=0
0
31
250
345
376
188
63
0
0
my code
for i=1:length(Cww)
S11(i)=100*Eww(i);
Fw(i)=Cww(i)/S11(i);
end
after this i get ans as
Fw=0 0 0 0 0 0 0 0 0 0
i get answer in row wise ,and result is wrong getting all zeros
I tried to do separately in command window
i get answer as
0
0
32767
8
32767
32767
32767
32767
0
0
why i get different answers,why i get 32767value plz provide assistance

采纳的回答

Walter Roberson
Walter Roberson 2012-11-23
Check the class() of your data. You are probably going to find that Eww (and possibly others) is int16 data class. Use double() to convert values from int16 to double precision.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Whos 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by