MATLAB: How to find if a vector has a repetitive element or not? And its repetition number

elementvector

For example
A=[ 1 3 1 1 2 3 5]

Best Answer

[a,b] = histc(A,unique(A));
count = a(b)
returns the number of occurences of each element in vector A in array "count".
Best wishes
Torsten.