フィルターのクリア

how can i delete every row with the same number?

1 回表示 (過去 30 日間)
Andrew
Andrew 2014 年 1 月 24 日
コメント済み: Andrew 2014 年 1 月 24 日
C =
2 4
2 4
2 2
2 2
3 1
3 4
2 4
3 4
4 3
>> e = unique(C, 'rows')
e =
2 2
2 4
3 1
3 4
4 3
if a have rows with the same numbers with unique(C, 'rows') i delete them but how can i delete every row with the same number?
for example
2 2
thank you

採用された回答

Image Analyst
Image Analyst 2014 年 1 月 24 日
Try this:
C =[...
2 4
2 4
2 2
2 2
3 1
3 4
2 4
3 4
4 3]
% Delete row if first element in a row
% equals the second element. (Must be integers).
rowsToDelete = C(:,1)==C(:,2)
C(rowsToDelete,:) = []
  1 件のコメント
Andrew
Andrew 2014 年 1 月 24 日
thank you!

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by