필터 지우기
필터 지우기

Find indexes of variables in vector

조회 수: 2 (최근 30일)
Jonasz
Jonasz 2013년 8월 12일
댓글: Andrew Reibold 2014년 7월 15일
I need to find indexes of variables in vector which are eg. out of my set range.
Range eg. from 600 to 2000
Vector of 1000 variables and I need only indxes of that variables which are out of this range.
Any ideas?

채택된 답변

the cyclist
the cyclist 2013년 8월 12일
편집: the cyclist 2013년 8월 12일
If x is your vector, then
idx = (x<600) | (x>2000);
is a logical index pointing to the out-of-range values.
If you need the actual positions,
idx = find((x<600) | (x>2000));
  댓글 수: 1
Andrew Reibold
Andrew Reibold 2014년 7월 15일
Thanks cyclist. Didn't realize you could use | or & in the find command.

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

추가 답변 (0개)

카테고리

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