Delete row with same value but in different columns

2 views (last 30 days)
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

Accepted Answer

Matt J
Matt J on 30 Apr 2021
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 Comments
Matt J
Matt J on 30 Apr 2021
Edited: Matt J on 30 Apr 2021
[~,idx] = unique(sort(angles_new,2),'rows');
angles_new=angles_new(idx,:); %unsorted

Sign in to comment.

More Answers (0)

Categories

Find more on Shifting and Sorting Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!