Select repeating elements in an matrix

1 visualización (últimos 30 días)
Maria Jesús Pérez Saiz
Maria Jesús Pérez Saiz el 3 de Jun. de 2021
Comentada: Sulaymon Eshkabilov el 3 de Jun. de 2021
I have this matrix:
1 44
1 24
2 56
1 26
2 51
2 56
I want to select all rows whose first column is a one.
That is, I want to get an array:
1 44
1 24
1 26
and on the other hand:
2 56
2 51
2 56
Thank you very much for the help

Respuesta aceptada

Sulaymon Eshkabilov
Sulaymon Eshkabilov el 3 de Jun. de 2021
A = [???] % Your data
B = A(A(:,1)==1, :)
Good luck
  2 comentarios
Maria Jesús Pérez Saiz
Maria Jesús Pérez Saiz el 3 de Jun. de 2021
Thank you very much for the help
Sulaymon Eshkabilov
Sulaymon Eshkabilov el 3 de Jun. de 2021
Most Welcome! It is just a pleasure to help.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Matrices and Arrays 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