Binary search
Version 1.0.0.0 (1.42 KB) by
dmitry.grigoryev@uha.fr
BSEARCH performs binary search on a sorted array
IND = BSEARCH(VEC, VAL, TOL) returns indexes of VEC elements equal to VAL
VEC must be sorted in ascending order (1, 2, 3, etc)
TOL > 0 means Y = X +/- TOL counts for a match
TOL = 0 means a search for exact matches
TOL = -1 means a search for the single closest element to VAL
Cite As
dmitry.grigoryev@uha.fr (2024). Binary search (https://www.mathworks.com/matlabcentral/fileexchange/30300-binary-search), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2007a
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on Search Path in Help Center and MATLAB Answers
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 |