How to improve plotting figure when averaging within bins
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!