find equal element rows in a matrix

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개)

Adam
Adam 2014년 8월 7일

1 개 추천

unique( sort( a, 2 ), 'rows' )
assuming a is your input array

카테고리

도움말 센터File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

질문:

adi
2014년 8월 7일

댓글:

2023년 4월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by