How to find index of rows without -999

1 vue (au cours des 30 derniers jours)
Leon
Leon le 6 Déc 2019
Commenté : Leon le 6 Déc 2019
I have a super long matrix like the below:
-5, 25, 35
-999, 8, 12
5, 7, 16
8, 9, -999
-999, -999, -999
22, 3, -999
How do I find the rows without any -999 (rows # 1 and 3 in this case) without writing a loop?
Thanks.

Réponse acceptée

Walter Roberson
Walter Roberson le 6 Déc 2019
find(~any(YourArray == -999,2))
  1 commentaire
Leon
Leon le 6 Déc 2019
Awesome! Thank you so much.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Tags

Produits


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by