How to plot line spectrum in matlab ?

28 visualizaciones (últimos 30 días)
Nguyen Trong Nhan
Nguyen Trong Nhan el 9 de Nov. de 2018
Respondida: Star Strider el 9 de Nov. de 2018
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.

Respuestas (2)

madhan ravi
madhan ravi el 9 de Nov. de 2018

Star Strider
Star Strider el 9 de Nov. de 2018
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')

Categorías

Más información sobre Spectral Measurements en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by