MATLAB: Total number of zeros , ones , twos..etc in a matrix

matrices

I have a matrix where in the fourth column there will be numbers of 0 to 23. I need a separate matrix where there will be the total numbers of 0s, 1s,2s ..23s etc. Say there will be 1000 0s, 3000 1s 24000 11s etc.

Best Answer

Let a be your data array.
[count_unique, unique_a] = hist(a,unique(a)) ;