equal elements in historgam bins
이전 댓글 표시
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
Image Analyst
2015년 8월 6일
34443 is not a multiple of 10 so how could all the bins have equal numbers in them?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!