How to cut duplicate rows from a matrix

3 visualizaciones (últimos 30 días)
John Hunt
John Hunt el 13 de Oct. de 2017
Editada: Cedric el 13 de Oct. de 2017
I have a matrix that has 60,000+ rows and there are duplicate of rows in this matrix example: [1 2 3; 1 2 3; 2 3 3; 2 3 3] How can I get a matrix that just has [1 2 3; 2 3 3]?

Respuesta aceptada

Cedric
Cedric el 13 de Oct. de 2017
Editada: Cedric el 13 de Oct. de 2017
A_uniqueRows = unique( A, 'rows' ) ;
or
A_uniqueRows = unique( A, 'rows', 'stable' ) ;
if you don't want the output to be sorted.

Más respuestas (0)

Categorías

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

Community Treasure Hunt

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

Start Hunting!

Translated by