Delete entire row of an array

How can I remove the entire row if either value is less than 5:
Coord =
2 3
2 39
1 88
9 74
10 93
16 28
16 50

 Respuesta aceptada

Stephen23
Stephen23 el 13 de En. de 2016
Editada: Stephen23 el 13 de En. de 2016

0 votos

>> Coord = [2,3;2,39;1,88;9,74;10,93;16,28;16,50];
>> Coord(any(Coord<5,2),:) = []
Coord =
9 74
10 93
16 28
16 50

Más respuestas (1)

Star Strider
Star Strider el 13 de En. de 2016
Alternatively:
Coord = Coord(~sum(Coord<5,2),:)
Coord =
9 74
10 93
16 28
16 50

2 comentarios

Jason
Jason el 13 de En. de 2016
Thanks
Star Strider
Star Strider el 13 de En. de 2016
My pleasure.

Iniciar sesión para comentar.

Categorías

Más información sobre Operators and Elementary Operations en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 13 de En. de 2016

Comentada:

el 13 de En. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by