MATLAB: Count how many times a number is repeated in a certain row of an array

MATLAB

Please consider the array
A = [1;1;1;2;2;2;2;2;3;3;4;4;4;4;4;4;4;5;5;5;5];
I would like to determine how many times each number repeats.
For 1, it repeats three times. For 2, it repeats five times, and so on.
If there is other data in columns to the left of the array A that does not follow the same repeating pattern, can I still count how many times each number in a certain column is repeated?

Best Answer

Here is a code;
A = [1;1;1;2;2;2;2;2;3;3;4;4;4;4;4;4;4;5;5;5;5];
c = unique(A); % the unique values in the A (1,2,3,4,5)
for i = 1:length(c)
counts(i,1) = sum(A==c(i)); % number of times each unique value is repeated
end
% c(1) is repated count(1) times