Delete row with same value but in different columns

 Réponse acceptée

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 commentaires

I have more than only two rows lol. I need to delete all but one.
unique(sort(angles_new,2),'rows');
This works but i do not want to sort my values since i need to keep the 3rd column element where it is.
Matt J
Matt J le 30 Avr 2021
Modifié(e) : Matt J le 30 Avr 2021
[~,idx] = unique(sort(angles_new,2),'rows');
angles_new=angles_new(idx,:); %unsorted
bbah
bbah le 30 Avr 2021
Thanks a lot

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

Community Treasure Hunt

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

Start Hunting!

Translated by