x: vector of numeric values, x should already be sorted in ascending order
sval: numeric value to be search in x
index: index of sval with respect to x. If sval is not found in x then index is empty.
Dr. Murtaza Khan (2022). Binary Search for numeric vector (https://www.mathworks.com/matlabcentral/fileexchange/11287-binary-search-for-numeric-vector), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Inspired by: Binary Search
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!