How do you plot frequency spectrum using fft function in MATLAB?

Answer:

Answer

plot(abs(fft(vectorname)))


the FFT function returns a complex vector thus when you plot it, you get a complex graph. If you plot the absolute value of the FFT array, you will get the magnitude of the FFT.

Note: There are comments associated with this question. See the discussion page to add to the conversation.
First answer by Pandoga. Last edit by Smitty McSmith. Contributor trust: 3 [recommend contributor recommended]. Question popularity: 31 [recommend question].