Binary Search for numeric vector

Search given value in a sorted vector, returns the index of location where the value is found.

Vous suivez désormais cette soumission

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.

Citation pour cette source

Dr. Murtaza Ali Khan (2026). Binary Search for numeric vector (https://fr.mathworks.com/matlabcentral/fileexchange/11287-binary-search-for-numeric-vector), MATLAB Central File Exchange. Extrait(e) le .

Remerciements

Inspiré par : Binary Search

Informations générales

Compatibilité avec les versions de MATLAB

  • Compatible avec toutes les versions

Plateformes compatibles

  • Windows
  • macOS
  • Linux
Version Publié le Notes de version Action
1.1.0.0

BSD License

1.0.0.0

Spelling corrections in description