MATLAB Answers

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

1 view (last 30 days)

Accepted Answer

Torsten on 23 Oct 2018
Edited: Torsten on 23 Oct 2018
[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


IBM watson
IBM watson on 23 Oct 2018
Actually i want to use your code for this:

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by