remove the repeating values in array
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Elysi Cochin
le 28 Nov 2013
Commenté : Azzi Abdelmalek
le 28 Nov 2013
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....
0 commentaires
Réponse acceptée
Andrei Bobrov
le 28 Nov 2013
Modifié(e) : Andrei Bobrov
le 28 Nov 2013
a = [ 29 29 29 29 25 25 29 29 27;
13 13 13 13 14 14 13 13 19];
[ii,ii] = unique(a','rows','first')
out = a(:,sort(ii));
2 commentaires
Plus de réponses (1)
Azzi Abdelmalek
le 28 Nov 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 commentaires
Voir également
Catégories
En savoir plus sur Multidimensional 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!