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

 Réponse acceptée

Stephen23
Stephen23 le 13 Jan 2016
Modifié(e) : Stephen23 le 13 Jan 2016

0 votes

>> 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

Plus de réponses (1)

Star Strider
Star Strider le 13 Jan 2016

1 vote

Alternatively:
Coord = Coord(~sum(Coord<5,2),:)
Coord =
9 74
10 93
16 28
16 50

2 commentaires

Jason
Jason le 13 Jan 2016
Thanks
Star Strider
Star Strider le 13 Jan 2016
My pleasure.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Operators and Elementary Operations dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by