How to find index of rows without -999

조회 수: 1 (최근 30일)
Leon
Leon 2019년 12월 6일
댓글: Leon 2019년 12월 6일
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.

채택된 답변

Walter Roberson
Walter Roberson 2019년 12월 6일
find(~any(YourArray == -999,2))
  댓글 수: 1
Leon
Leon 2019년 12월 6일
Awesome! Thank you so much.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by