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?

 Accepted Answer

dpb
dpb on 5 Aug 2019
Edited: dpb on 5 Aug 2019
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
>>

More Answers (0)

Categories

Find more on Fourier Analysis and Filtering in Help Center and File Exchange

Products

Release

R2019a

Asked:

on 5 Aug 2019

Edited:

dpb
on 5 Aug 2019

Community Treasure Hunt

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

Start Hunting!