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

1 vue (au cours des 30 derniers jours)
For example
A=[ 1 3 1 1 2 3 5]
  2 commentaires
Torsten
Torsten le 23 Oct 2018
What is "repetition number" ? The number of repetitions of each element of A ?
IBM watson
IBM watson le 23 Oct 2018
Yes. I was trying to say that

Connectez-vous pour commenter.

Réponse acceptée

Torsten
Torsten le 23 Oct 2018
Modifié(e) : Torsten le 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
Torsten.
  2 commentaires
IBM watson
IBM watson le 23 Oct 2018
Modifié(e) : IBM watson le 23 Oct 2018
Actually i want to use your code for this:
https://www.mathworks.com/matlabcentral/answers/425580-setdiff-comand-usage?s_tid=mlc_ans_email_view#answer_342895

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by