Binary Search for numeric vector
バージョン 1.1.0.0 (2.5 KB) 作成者:
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.
引用
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. 取得済み .
MATLAB リリースの互換性
作成:
R14SP2
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linuxカテゴリ
Help Center および MATLAB Answers で Shifting and Sorting Matrices についてさらに検索
タグ
謝辞
ヒントを得たファイル: Binary Search
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!