Using find between two points

조회 수: 38 (최근 30일)
Darpan Verma
Darpan Verma 2019년 3월 11일
댓글: Darpan Verma 2019년 3월 11일
Hello Everyone,
I am trying to use find in between two points, which is giving me error.
When I use
index = find(x>4)
it gives me all 100 values which are greater than x>4
if I use
index = find((x>4) && (x<6))
It gives me error: Operands to the || and && operators must be convertible to logical scalar
values.
I wanted to know how I can find the values by giving two conditions.

채택된 답변

David Goodmanson
David Goodmanson 2019년 3월 11일
Hi Darpan,
try it with just one & sign. && is for scalar comparisons, and you have a vector on each side.
  댓글 수: 1
Darpan Verma
Darpan Verma 2019년 3월 11일
Thanks David That worked. :)

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by