How to remove identical pair of data from a matrix in MATLAB?

1 次查看(过去 30 天)
I have a Nx2 matrix with identical pairs. Something like this:
b_data = [ 1 2; 3 4; 7 10; 2 1; 10 7; 11 12];
i consider 1 2, 2 1 as identical
I need to make this
b_data = [1 2; 3 4;7 10; 11 12];
Is there any command for doing so?

采纳的回答

Jonas
Jonas 2021-5-11
use something like
unique(sort([1 2; 2 1; 3 5],2),'rows')
  4 个评论
Rik
Rik 2021-5-11
Ah, sorry, I must have read it too quickly. Have an upvote as an apology.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Shifting and Sorting Matrices 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by