is this is a bug for fft program?

i am a student in china.
i get diffrent result when i run the code below:
fft([1,2,3,4],4).'
fft([1,2,3,4],4)'
the first:
10.0000 + 0.0000i
-2.0000 + 2.0000i
-2.0000 + 0.0000i
-2.0000 - 2.0000i
the 2th
10.0000 + 0.0000i
-2.0000 - 2.0000i
-2.0000 + 0.0000i
-2.0000 + 2.0000i
but i think it should be the same
could you tell me where is wrong?

 采纳的回答

dpb
dpb 2019-8-5
编辑:dpb 2019-8-5
See the documentation for
doc transpose % .'
doc ctranspose % '
You're transposing the output of the fft() which is complex; in Matlab the ' operator is the complex transpose whereas the "dot" version .' is non-complex transpose.
So, it is doing exactly what is documented to do--
ADDENDUM
And, to emphasize what SS said, the output of fft() itself is identical as would be expected--it was given identical inputs.
The transpose operators are applied to the output of fft(); it (fft, that is) has actually nothing whatsoever to do with the result at that point; its job was done and over before the interesting action occurred.
Same as if had written
>> complex(-2,2)
ans =
-2.0000 + 2.0000i
>> complex(-2,2)'
ans =
-2.0000 - 2.0000i
>> complex(-2,2).'
ans =
-2.0000 + 2.0000i
>>
which clearly demonstrates the properties of the transpose operators has nothing to do with the source of the data (and vice versa); it simply has to be a complex value before one can observe the difference since w/o an imaginary component the complex conjugate is a "do nothing" operation.
>> [1:4]
ans =
1 2 3 4
>> [1:4]'
ans =
1
2
3
4
>> [1:4].'
ans =
1
2
3
4
>>

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息

产品

版本

R2019a

标签

Community Treasure Hunt

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

Start Hunting!

Translated by