简体   繁体   中英

Find the minimum value above a certain threshold

I am trying to find the min value for values equal to or above 3. this doesn't work

A = [21,1, 2, 3, 4, 5, 6, 7, -1, 8, 9, 10]; 
idx=find(3<A & A==min(A)); 
A(idx)

您可以在Matlab中使用逻辑索引

min( A( A >= 3 ) )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM