Apply a function to each pixel of a stack of matrices

array_apply(arr, fun)

Arguments

arr

a three-dimensional array

fun

a function to apply at each row and column of the input array. The function will be called with a vector of the z-values as a single argument.

Value

an array containing the values returned by fun at each pixel