How to find index of rows without -999

1 visualizzazione (ultimi 30 giorni)
Leon
Leon il 6 Dic 2019
Commentato: Leon il 6 Dic 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.

Risposta accettata

Walter Roberson
Walter Roberson il 6 Dic 2019
find(~any(YourArray == -999,2))

Più risposte (0)

Categorie

Scopri di più su Get Started with MATLAB in Help Center e File Exchange

Tag

Prodotti


Release

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by