equal elements in historgam bins
Show older comments
According to the help menu:
Calculate four evenly spaced quantiles.
y = quantile(x,4)
I want 10 bins with equal elements in each bin I tried :
y=quantile(x,10)
then
[counts,Id] = histc(x,y)
I received
counts=[3131
3130
3130
3130
3131
3130
3130
3130
3131
0]
and
Id=[ 0
1
2
3
4
5
6
7
8
9]
The issue is that the groups are 10 (0 to 9) but 3130 x 10 is not equal to the vector size of 34443x1. I a missing something here. as the size of each bin should be around 3443 and not 3130. Kindly, could you please spot the error and divide the histogram to 10 bins with equal elements?
1 Comment
Image Analyst
on 6 Aug 2015
34443 is not a multiple of 10 so how could all the bins have equal numbers in them?
Accepted Answer
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!