Binary Search

Binary search of values in a data vector.
6,1K Downloads
Aktualisiert 20. Okt 2005

Lizenz anzeigen

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.

Zitieren als

Aroh Barjatya (2026). Binary Search (https://de.mathworks.com/matlabcentral/fileexchange/7552-binary-search), MATLAB Central File Exchange. Abgerufen.

Kompatibilität der MATLAB-Version
Erstellt mit R13
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Kategorien
Mehr zu File Operations finden Sie in Help Center und MATLAB Answers
Quellenangaben

Inspiriert: Binary Search for numeric vector

Version Veröffentlicht Versionshinweise
1.0.0.0

update for out of bound values