Binary Search for numeric vector
Version 1.1.0.0 (2,5 KB) von
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.
Zitieren als
Dr. Murtaza Ali Khan (2026). Binary Search for numeric vector (https://de.mathworks.com/matlabcentral/fileexchange/11287-binary-search-for-numeric-vector), MATLAB Central File Exchange. Abgerufen.
Kompatibilität der MATLAB-Version
Erstellt mit
R14SP2
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS LinuxKategorien
Mehr zu Shifting and Sorting Matrices finden Sie in Help Center und MATLAB Answers
Tags
Quellenangaben
Inspiriert von: Binary Search
Live Editor erkunden
Erstellen Sie Skripte mit Code, Ausgabe und formatiertem Text in einem einzigen ausführbaren Dokument.
| Version | Veröffentlicht | Versionshinweise | |
|---|---|---|---|
| 1.1.0.0 | BSD License |
||
| 1.0.0.0 | Spelling corrections in description |
