필터 지우기
필터 지우기

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,:) = []

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by