MATLAB: Error in dividing the data

dividionmutliplication

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

Best Answer

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.