How to cut duplicate rows from a matrix

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]?

 採用された回答

Cedric
Cedric 2017 年 10 月 13 日
編集済み: Cedric 2017 年 10 月 13 日

0 投票

A_uniqueRows = unique( A, 'rows' ) ;
or
A_uniqueRows = unique( A, 'rows', 'stable' ) ;
if you don't want the output to be sorted.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeShifting and Sorting Matrices についてさらに検索

質問済み:

2017 年 10 月 13 日

編集済み:

2017 年 10 月 13 日

Community Treasure Hunt

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

Start Hunting!

Translated by