Apply function to each page of distributed array or gpuArray
applies the function specified by A
= pagefun(FUN
,B
)FUN
to each page of the
distributed array or gpuArray B
. The result
A
contains each page of results such that
A(:,:,I,J,...) = FUN(B(:,:,I,J,...))
.
A
is a distributed array or a gpuArray, depending on the
array type of B
. FUN
is a handle to a
function that takes a two-dimensional input argument.
evaluates A
= pagefun(FUN
,B1,...,Bn
)FUN
using pages of the arrays
B1,...,Bn
as input arguments with scalar expansion
enabled. Any of the input page dimensions that are scalar are virtually
replicated to match the size of the other arrays in that dimension so that
A(:,:,I,J,...) =
FUN(B1(:,:,I,J,...),...,Bn(:,:,I,J,...))
. The input pages
B(:,:,I,J,...),...,Bn(:,:,I,J,...)
, must satisfy all of
the input requirements of FUN
.
If you plan to make several calls to pagefun
, it is more
efficient to first convert that array to a distributed array or gpuArray.
[
returns multiple output arrays A1,...,Am
] = pagefun(FUN
,___)A1,...,Am
when the function
FUN
returns m
output values.
pagefun
calls FUN
each time with as
many outputs as there are in the call to pagefun
, that is,
m
times. FUN
can return output
arguments having different data types, but the data type of each output must be
the same each time FUN
is called.