Map function in MATLAB?
The short answer: the built-in function arrayfun does exactly what your map function does for numeric arrays: >> y = arrayfun(@(x) x^2, 1:10) y = 1 4 9 16 25 36 49 64 81 100 There are two other built-in functions that behave similarly: cellfun (which operates on elements of cell arrays) and structfun (which … Read more