Binary Search for numeric vector
Versione 1.1.0.0 (2,5 KB) da
Dr. Murtaza Ali Khan
Search given value in a sorted vector, returns the index of location where the value is found.
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.
Cita come
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. Recuperato .
Compatibilità della release di MATLAB
Creato con
R14SP2
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS LinuxCategorie
Scopri di più su Shifting and Sorting Matrices in Help Center e MATLAB Answers
Tag
Riconoscimenti
Ispirato da: Binary Search
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Scopri Live Editor
Crea script con codice, output e testo formattato in un unico documento eseguibile.