MATLAB: Frequency against every value

histogram

i have dataset with column data,the last column in the dataset which i have attached.i want to calculate all number of data greater than 4 ,greater than 4.1, greater than 4.2 so on ….data sample is as Data
data
6
4.7
4.4
4.3
4.2
4.8
4
4.2
4.2
4.6
4.1
4.2
4.4
4.4
4.1
4.9
4.5
4.1
4.1
4.2
5
4.6
5.4
4
4.4
4.4
4.1
4.4
4
4
4.9
4.4
4.2
4.2
4.8
6
5.1
4.7
4
4
4.3
4.3
4.1
4
4
4.2
4.2
4.2
4.2
4.1
4.6
4.2
4.3
4.1
4.1
4.4
4.4
4.4
4.4
4.7
4.7
4.1
4.3
4.3
4.2
4.4
4.3
4.4
4.8
4.8
4.2
4.2
4.8
5.5
4.7
4.1
4.2
4.1
4.1
4.1
4.1
4.6
4.6
4.6
4.1
4
5.2
5.5
4.6
4.1
4.1
4.1
4.2
4.2
4
4.5
4.8
4.7
4.6

Best Answer

Bearing in mind that the number of data greater than 4 also includes the number of data greater than 4.1, what you are asking for is a cumulative histogram but in reverse.
The histcounts function does cumulative histogram (the 'cumcount' option of 'normalization'), but not in reverse. No matter, you can reverse the ordering of your data simply by negating it:
bins = 6:-0.1:3.9; %note that it's 3.9 instead of 4 due to the way histcounts treat the last bin
count = fliplr(histcounts(-data, -bins, 'Normalization', 'cumcount')
count is the reversed cumulative histogram starting at 4, finishing at 5.9. That is count(1) is the number of data > 4, count(2) the number > 4.1, ... count(99) the number > 5.9.