How do I plot distribution of time lags using histogram with a smoothed line?

2 ビュー (過去 30 日間)
LJ
LJ 2020 年 8 月 2 日
回答済み: Rik 2020 年 8 月 2 日
x=[-24,54,90,0,0,-36,-30,42,6,54,48,-36,72,12,-42]; %time lags
h=histogram(x)
xticklabels(-48:24:96)
%y-axis: count (how many times lag value appeared in x)
I would want a smoothed line of the lag values (any time resolution).
If I use plot, what values of y should I input?

採用された回答

Rik
Rik 2020 年 8 月 2 日
h.BinCounts contains the height of each bar and h.BinEdges can be used to find the bin centers. If you want to smooth the resulting line, you will have to use some form of interpollation. I doubt you will get a nice result with so few data points.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeHistograms についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by