remove the repeating values in array
Mostrar comentarios más antiguos
i have an array with 2 rows 9 columns values
29 29 29 29 25 25 29 29 27
13 13 13 13 14 14 13 13 19
i wanted to remove the repeating values and get the output as
29 25 27
13 14 19
what code should i write to remove the repeated values?? please do reply....
Respuesta aceptada
Más respuestas (1)
Azzi Abdelmalek
el 28 de Nov. de 2013
a=[29 29 29 29 25 25 29 29 27;
13 13 13 13 14 14 13 13 19];
b=a'
[ii,jj]=unique(a','rows')
out=b(sort(jj),:)'
3 comentarios
Elysi Cochin
el 28 de Nov. de 2013
Elysi Cochin
el 28 de Nov. de 2013
Azzi Abdelmalek
el 28 de Nov. de 2013
It's in that order
Categorías
Más información sobre Shifting and Sorting Matrices 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!