![]() |
IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
|
Binary Search.
Written by Aroh Barjatya
Binary search for values specified in vector 'var' within data vector 'x' The data has to be pre-sorted in ascending or decending order There is no way to predict how the function will behave if there are multiple numbers with same value. returns the index values of the searched numbers
flag_bin
added by JT. flag_bin
= 1 will cause to return the index corresponding to the highest number in case of var
being between two numbers.
Definition in file bsearch.m.
Go to the source code of this file.
Functions | |
function | bsearch (in x, in var, in flag_bin) |
function bsearch | ( | in | x, |
in | var, | ||
in | flag_bin | ||
) |
x | |
var | |
flag_bin |