Hi there, I have a strange problem when doing the summation for my array.
I got a array of 1x64 complex double. I would like to calculate the sum of those 64 elements.
However the result come out was quite strange and I don't know where I got wrong....
'sle' is the name of the data.
I did try with real(sle) and imag(sle). Although real(sle) did give me kind of a sensible answer(I suppose), in imag(sle) from element 33 to element 40 did show a imaginary value. Which is strange because when I look back at the data, there was no corresponding imaginary numbers that present in sle.
Anyone know the reason why? Please help... ><
sle =
1 至 7 列
0.1250 + 0.0000i 0.1250 + 0.0000i 0.1250 + 0.0000i 0.1250 + 0.0000i 0.1250 + 0.0000i 0.1250 + 0.0000i 0.1250 + 0.0000i
8 至 14 列
0.1250 + 0.0000i -0.1250 + 0.0000i -0.1250 + 0.0000i -0.1250 + 0.0000i -0.1250 + 0.0000i -0.1250 + 0.0000i -0.1250 + 0.0000i
15 至 21 列
-0.1250 + 0.0000i -0.1250 + 0.0000i 0.3750 + 0.0000i 0.3750 + 0.0000i 0.3750 + 0.0000i 0.3750 + 0.0000i 0.3750 + 0.0000i
22 至 28 列
0.3750 + 0.0000i 0.3750 + 0.0000i 0.3750 + 0.0000i -0.3750 + 0.0000i -0.3750 + 0.0000i -0.3750 + 0.0000i -0.3750 + 0.0000i
29 至 35 列
-0.3750 + 0.0000i -0.3750 + 0.0000i -0.3750 + 0.0000i -0.3750 + 0.0000i -0.1250 + 0.0000i -0.1250 - 0.0000i -0.1250 + 0.0000i
36 至 42 列
-0.1250 - 0.0000i -0.1250 + 0.0000i -0.1250 - 0.0000i -0.1250 + 0.0000i -0.1250 - 0.0000i 0.1250 + 0.0000i 0.1250 + 0.0000i
43 至 49 列
0.1250 + 0.0000i 0.1250 + 0.0000i 0.1250 + 0.0000i 0.1250 + 0.0000i 0.1250 + 0.0000i 0.1250 + 0.0000i -0.3750 + 0.0000i
50 至 56 列
-0.3750 + 0.0000i -0.3750 + 0.0000i -0.3750 + 0.0000i -0.3750 + 0.0000i -0.3750 + 0.0000i -0.3750 + 0.0000i -0.3750 + 0.0000i
57 至 63 列
0.3750 + 0.0000i 0.3750 + 0.0000i 0.3750 + 0.0000i 0.3750 + 0.0000i 0.3750 + 0.0000i 0.3750 + 0.0000i 0.3750 + 0.0000i
64 列
0.3750 + 0.0000i
sum(sle)
ans =
-1.7764e-15