Delete row with same value but in different columns

2 ビュー (過去 30 日間)
bbah
bbah 2021 年 4 月 30 日
コメント済み: bbah 2021 年 4 月 30 日
I have a matrix like:
[1 1 2 1 47 ; 1 1 47 1 2]
How to delete one of the rows and keep the other ?
Thanks

採用された回答

Matt J
Matt J 2021 年 4 月 30 日
For example, to delete the first row,
A=[1 1 2 1 47 ; 1 1 47 1 2]
A = 2×5
1 1 2 1 47 1 1 47 1 2
A(1,:)=[]
A = 1×5
1 1 47 1 2
  3 件のコメント
Matt J
Matt J 2021 年 4 月 30 日
編集済み: Matt J 2021 年 4 月 30 日
[~,idx] = unique(sort(angles_new,2),'rows');
angles_new=angles_new(idx,:); %unsorted
bbah
bbah 2021 年 4 月 30 日
Thanks a lot

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeShifting and Sorting Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by