fast array substitution

a function to substitute entries of an array using rules From(i) -> To(i)
123 Descargas
Actualizado 1 jul 2014

Ver licencia

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.

Citar como

Ondrej Budac (2026). fast array substitution (https://es.mathworks.com/matlabcentral/fileexchange/47101-fast-array-substitution), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2014a
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Categorías
Más información sobre Matrices and Arrays en Help Center y MATLAB Answers.
Etiquetas Añadir etiquetas
Versión Publicado Notas de la versión
1.1.0.0

added an icon

1.0.0.0