How to plot line spectrum in matlab ?

16 ビュー (過去 30 日間)
Nguyen Trong Nhan
Nguyen Trong Nhan 2018 年 11 月 9 日
回答済み: Star Strider 2018 年 11 月 9 日
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 Center および File ExchangeFourier 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