Borrar filtros
Borrar filtros

Delete row with same value but in different columns

1 visualización (últimos 30 días)
bbah
bbah el 30 de Abr. de 2021
Comentada: bbah el 30 de Abr. de 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

Respuesta aceptada

Matt J
Matt J el 30 de Abr. de 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 comentarios
Matt J
Matt J el 30 de Abr. de 2021
Editada: Matt J el 30 de Abr. de 2021
[~,idx] = unique(sort(angles_new,2),'rows');
angles_new=angles_new(idx,:); %unsorted
bbah
bbah el 30 de Abr. de 2021
Thanks a lot

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Shifting and Sorting Matrices en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by