Binary Search for numeric vector

Search given value in a sorted vector, returns the index of location where the value is found.
3,8K descargas
Actualizado 9 jul 2009

Ver licencia

INPUT:
x: vector of numeric values, x should already be sorted in ascending order
(e.g. 2,7,20,...120)
sval: numeric value to be search in x

OUTPUT:
index: index of sval with respect to x. If sval is not found in x then index is empty.

Citar como

Dr. Murtaza Ali Khan (2024). Binary Search for numeric vector (https://www.mathworks.com/matlabcentral/fileexchange/11287-binary-search-for-numeric-vector), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R14SP2
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Categorías
Más información sobre Shifting and Sorting Matrices en Help Center y MATLAB Answers.
Agradecimientos

Inspirado por: Binary Search

Community Treasure Hunt

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

Start Hunting!

binarysearchnumvec/

Versión Publicado Notas de la versión
1.1.0.0

BSD License

1.0.0.0

Spelling corrections in description