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

5 次查看(过去 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 中查找有关 Creating and Concatenating Matrices 的更多信息

标签

尚未输入任何标签。

Community Treasure Hunt

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

Start Hunting!

Translated by