I'm looking for a vectorized method of processing k identically-sized N-dimensional arrays provided as an N+1-dimension array in Matlab.
If a general solution is not available, then a specific solution where N = 2, perhaps?
The closest thing I've found is pagefun
which applies a function to each 2-dimensional page in a 3-dimensional parameter, but (in a reversal of the common situation) it seems that can only be used with GPU data.
Basically, a vectorized version of
function R = apply(fn, M)
for i = size(M)(1, end)
R(:,:,..,i) = fn(M(:,:,..,i));
end