How to plot line spectrum in matlab ?

65 次查看(过去 30 天)
I would like to plot a spectrum (output of FFT) with a form like the provided image. How do I do it? Because the common plot in matlab is connecting of all point.

回答(2 个)

madhan ravi
madhan ravi 2018-11-9

Star Strider
Star Strider 2018-11-9
Use the stem (link) function for the plot.
Example
f = 0:0.1:3.5; % Create Frequency Vector
h = exp(-f) + 0.5*rand(size(f)); % Create Amplitude Vector
figure
stem(f, h, 'Marker','none')

类别

Help CenterFile Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息

标签

产品


版本

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by