MATLAB: How to find index of rows without -999

findMATLAB

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.

Best Answer

find(~any(YourArray == -999,2))