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

3 visualizaciones (últimos 30 días)
For example
A=[ 1 3 1 1 2 3 5]

Respuesta aceptada

Torsten
Torsten el 23 de Oct. de 2018
Editada: Torsten el 23 de Oct. de 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 comentarios
IBM watson
IBM watson el 23 de Oct. de 2018
Editada: IBM watson el 23 de Oct. de 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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by