How to find the number of times an elements occurs in an array and copy to another array with same index
Mostrar comentarios más antiguos
What I need is to find the number of times the elements repeat themselves in an array and copy the count to another array with the same index. I'll illustrate what i want by example:
A[4]=[1 4 6 1 5]
B[6]=[2 0 0 1 1 1]
Here,1 appears twice in A, so B[1]=2, 2 doesn't appear so B[2]=0, 3 doesn't appear so B[3]=0, 4,5 and 6 appear once so B[4]=1,B[5]=1,B[6]=1.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Data Types en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!