Find index of points between two points?

1 次查看(过去 30 天)
Hi all,
I have an Array A
A =[1,2,5,8,4,7,6,3,12].
I want to find the index of those elements which grater than element 5 and less than 7.
I am writting like this but failed to get solution.
Y_min=5;
Y_max=7;
idx = find((A>Y_min) && (A<Y_max));

回答(1 个)

per isakson
per isakson 2020-11-13
编辑:per isakson 2020-11-13
>> A =[1,2,5,8,4,7,6,3,12];
>> Y_min=5;
>> Y_max=7;
>> idx = find((A>Y_min) & (A<Y_max));
>> idx
idx =
7

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

标签

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by