Binary Search of Elements lying within an Interval (Scripts) Publisher's description
from Roberto Olmi
Search the elements that are lying within a specified interval
Search the elements that are lying within a specified interval.
Search the indexes of all elements in x (sorted vector of n elements) that lie within the interval.
The algorithm uses binary searches, thus it runs in log(n)
x: vector of numeric values sorted in ascending order
ref: numeric value of the reference point (center of the interval)
tol: numeric value corresponding to 1/2 of the width of the interval
The fourth input argument: numeric value (optional). Allows to define the maximum number of elements of x that can lie within the specified interval. This is useful in order to speed up the search.
indexes: indexes of elements of x which lie within the interval [ref-tol ref+tol]
If ref is not found in x then indexes is empty.
System Requirements:MATLAB 7.6 (R2008a)
Program Release Status: New Release
Program Install Support: Install and Uninstall