我正在尝试在数组A中查找所有索引,其中值大于time0且小于time1。在matlab中,我可以执行以下操作:
[M,F] = mode( A((A>=time0) & (A<=time1)) ) %//only interested in range
我在IDL中有类似的东西,但是速度很慢:
tmpindex0 = where(A ge time0)
tmpindex1 = where(A lt time1)
M = setintersection(tmpindex0,tmpindex1)
其中setintersection()是函数,用于查找两个数组之间的相交元素。什么是快速的替代实现?
您可以结合您的条件: