Searching matrix which contain specific value?

조회 수: 9 (최근 30일)
Bishwam Pattnaik
Bishwam Pattnaik 2019년 8월 17일
댓글: Bishwam Pattnaik 2019년 8월 17일
Hi, i got two matrices of same size? lets say i am searching for a particular value? how can i use a counter loop to Return 1 if that matrix contain that value and return 0 if that matrix doesn't not contain the value?
  댓글 수: 1
Bishwam Pattnaik
Bishwam Pattnaik 2019년 8월 17일
Like for example, i got a matrix [1,2,3,4,5,6,7,8,9] and another matrix like [10,11,12,13, 14,15,16,17,18,19]. The question is if the any of this matrix contains values greter than 15 return 1 otherwise 0? how can i do it.

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

답변 (1개)

madhan ravi
madhan ravi 2019년 8월 17일
편집: madhan ravi 2019년 8월 17일
any(matrix(:)==value) % 1 means true ,false otherwise

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by