fast array substitution

バージョン 1.1.0.0 (1.69 KB) 作成者: Ondrej Budac
a function to substitute entries of an array using rules From(i) -> To(i)
ダウンロード: 123
更新 2014/7/1

ライセンスの表示

Given a numerical array A and two arrays From and To of equal size, we would like to make substitution From(i)->To(i) in the array A for every i.
If the number of values to substitutes (numel(From)) is small, one can use a vectorized code to substitute the values one-by-one. However, this is too costy if there are too many substitutions. In this case, the provided function uses a different algorithm. It sorts the array A and the substitution rules and then it does one non-vectorized sweep of the inputs. Finally, we restore the original order and shape of A.

引用

Ondrej Budac (2024). fast array substitution (https://www.mathworks.com/matlabcentral/fileexchange/47101-fast-array-substitution), MATLAB Central File Exchange. に取得済み.

MATLAB リリースの互換性
作成: R2014a
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersMatrices and Arrays についてさらに検索
タグ タグを追加

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
バージョン 公開済み リリース ノート
1.1.0.0

added an icon

1.0.0.0