Effacer les filtres
Effacer les filtres

How to eliminate duplicate rows in an array without changing their orders?

1 vue (au cours des 30 derniers jours)
I have an array:
DOM =
[1 1 1 0;
1 1 1 0;
0 1 0 0;
0 1 0 0;
1 0 1 0;
1 0 1 0]
I need to eliminate the dublicate rows but without changing the order of the rows in Dom. I s there a MATLAB function for doing so or do I have to write a loop?
I tried
D=unique(DOM, 'rows');
D =
0 1 0 0
1 0 1 0
1 1 1 0
Thanks

Réponse acceptée

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH le 17 Fév 2020
D=unique(DOM,'rows','stable')

Plus de réponses (0)

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!

Translated by