FUNCTION REFERENCE
arrayfun
Apply a function to each element of an array.
Apply a function to each element of an array.
Syntax
A = arrayfun(f, X)Syntax
[A, B] = arrayfun(f, X, Y)Syntax
C = arrayfun(f, X, 'UniformOutput', false)Calls f once per element (all inputs must have the same size) and collects the results in an array of that size. Each call must return scalars of one class unless UniformOutput is false, which collects the results in cell arrays.
Example
arrayfun(@(x) x^2, [1 2 3]) % [1 4 9]Differences from MATLAB: ErrorHandler is not supported.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.