find equal element rows in a matrix

3 ビュー (過去 30 日間)
adi
adi 2014 年 8 月 7 日
コメント済み: Terence Etchells 2023 年 4 月 7 日
I have a matrix, in witch some rows have the same elements in different order. I want to keep only one row that has a specific set of elements. for example, if I have:
1 3
2 5
3 1
2 3
5 2
I would like to convert this matrix to:
1 3
2 5
2 3
anyone?
  1 件のコメント
Terence Etchells
Terence Etchells 2023 年 4 月 7 日
which

サインインしてコメントする。

回答 (1 件)

Adam
Adam 2014 年 8 月 7 日
unique( sort( a, 2 ), 'rows' )
assuming a is your input array

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by