How to improve plotting figure when averaging within bins

2 ビュー (過去 30 日間)
laura9510
laura9510 2017 年 2 月 9 日
I am trying to take the mean of bins that I assign and have done so in the following way:
binEdge = linspace(min(a), max(a), 5);
[n,bin] = histc(a, binEdge);
A = accumarray(bin(:),P1,[],@mean)
figure
plot(binEdge, A);
xticks([0, 0.02, 0.04, 0.06, 0.08, 0.1);
However the plot I am getting doesn't show a single value for each bin i.e. like a stepwise function would look. It's all linear and I'm wondering how to change that. Thanks

回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by