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 CenterFile Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by