9:35 AM
"Apply function X to range or array Y" cannot be done for a general function. MATL doesn't have a concept of a callable function. Take for example XQ
(accumarray
). In MATLAB you can use accumarray(..., f)
for any function (handle) f
. But in MATL XQ
takes a number which specifies a predefined set of allowed functions.
Similarly, there are cummax
and cumsum
, but not a way to have an arbitrary function be applied cumulatively.
Introducing that sort of thing would be a big change to the language, not just the compiler.