Binary Search

Binary search of values in a data vector.

現在この提出コンテンツをフォロー中です。

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.

引用

Aroh Barjatya (2026). Binary Search (https://jp.mathworks.com/matlabcentral/fileexchange/7552-binary-search), MATLAB Central File Exchange. に取得済み.

謝辞

ヒントを与えたファイル: Binary Search for numeric vector

カテゴリ

Help Center および MATLAB AnswersFile Operations についてさらに検索

一般的な情報

MATLAB リリースの互換性

  • すべてのリリースと互換性あり

プラットフォームの互換性

  • Windows
  • macOS
  • Linux
バージョン 公開済み リリース ノート Action
1.0.0.0

update for out of bound values