MATLAB - 如何找到值大于阈值的第一个索引 [英] MATLAB - how do I find the first index where value is greater than threshold
本文介绍了MATLAB - 如何找到值大于阈值的第一个索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能存在重复:
给定一个向量a = [1,2,3.2 ,4,5]和一个元素x = 3在向量a中,如何找到大于x的确切条目?
假设一个[]是一个排序的向量。如何找到第一个(最小)索引ix,使得(ix)>阈值?
c $ c> ix = find(a> threshold,1);
很确定这会起作用
Possible Duplicate:
Given a vector a=[1,2, 3.2, 4, 5] and an element x=3 In vector a, how to find the exact entry which is bigger than x?
Let's say a[] is a sorted vector. How do I find the first(smallest) index ix such that a(ix) > threshold?
解决方案
ix = find(a>threshold,1);
Pretty sure this will work
这篇关于MATLAB - 如何找到值大于阈值的第一个索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文