How about using accumarray function? The following is an example:
% Sample data (column vector containing 1~10 randomly)
data = randi(10,80,1);
% Count how many times 1~10 appears
count = accumarray(data,1);
% Arrange the result
number = (1:10)';
T = table(number,count);
>> T
T =
10×2 table
number count
______ _____
1 7
2 10
3 4
4 3
5 8
6 11
7 9
8 7
9 13
10 8