Filter löschen
Filter löschen

Delete row with same value but in different columns

1 Ansicht (letzte 30 Tage)
bbah
bbah am 30 Apr. 2021
Kommentiert: bbah am 30 Apr. 2021
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

Akzeptierte Antwort

Matt J
Matt J am 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 Kommentare
Matt J
Matt J am 30 Apr. 2021
Bearbeitet: Matt J am 30 Apr. 2021
[~,idx] = unique(sort(angles_new,2),'rows');
angles_new=angles_new(idx,:); %unsorted
bbah
bbah am 30 Apr. 2021
Thanks a lot

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Shifting and Sorting Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by