help in making a cumulative histogram, histc or accumarray?
2 次查看(过去 30 天)
显示 更早的评论
All,
I have some data that I would like to create a cumulative histogram of. The bins I would like to use are like
bins=[0.2 15 0.4 15 0.6 15 0.8 15 1 15 1.2 15 1.4 15 1.6 15 1.8 15 2 15];
and a section of my data looks like
data = [0.072
0.085
0.118
0.200
0.325
0.527
0.823
1.193
1.553
1.822
1.952
1.907
1.707
1.468
1.287
1.200
1.138
1.038
0.898
0.778
0.667
0.599
0.563
0.511
0.434
0.356
0.300
0.266
0.247
0.216
0.199
0.183
0.165
0.131
0.081
0.058
0.051
0.037
0.022
0.019
0.032
0.034
0.034
0.034
0.033
0.020
0.017
0.016
0.017
0.017
0.003];
Given that the bins are non monotonically decreasing/increasing, accumarray and histc throw up errors, does anyone know how I might make this kind of cumulative histogram?
Thanks,
Jim
0 个评论
采纳的回答
更多回答(1 个)
Image Analyst
2012-10-24
Why can't you just sort your bins and then pass them into histc. But you didn't specify if your bins were bin centers or bin edges.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Distribution Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!