matlab code to find the position of values in a vector within the specified range that meets a certain condition?

조회 수: 2 (최근 30일)
how to find the index positions of values in a vector within the specified range that meets a certain condition?
ex: d=[1 2 14 20 10 15 2 4 9 7 5]
my range(index positions) is 3 to 6
condition is(value < 15)
the output should be [3 5]

채택된 답변

Preethi
Preethi 2016년 11월 28일
hi,
d=[1 2 14 20 10 15 2 4 9 7 5];
x =find(d<15)
y =x(x<=6 & x>=3)

추가 답변 (0개)

카테고리

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

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by