Binary Search

Binary search of values in a data vector.
6,1K téléchargements
Mise à jour 20 oct. 2005

Afficher la licence

bsearch(x,var)

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. If the values in 'var' are outside the range of 'x' then either 1 or length(x) are returned as indices for those values.

Citation pour cette source

Aroh Barjatya (2024). Binary Search (https://www.mathworks.com/matlabcentral/fileexchange/7552-binary-search), MATLAB Central File Exchange. Extrait(e) le .

Compatibilité avec les versions de MATLAB
Créé avec R13
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux
Catégories
En savoir plus sur File Operations dans Help Center et MATLAB Answers
Remerciements

A inspiré : Binary Search for numeric vector

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Publié le Notes de version
1.0.0.0

update for out of bound values