pagefun
Apply function to each page of distributed or GPU array
Description
applies the function specified by A
= pagefun(FUN
,B
)FUN
to each page of the distributed or
GPU array B
. The result A
contains each page of
results such that A(:,:,I,J,...) = FUN(B(:,:,I,J,...))
.
A
is a distributed or GPU array, 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 or GPU array.
[
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. If
you call pagefun
with more output arguments than supported by
FUN
, MATLAB® generates an error. 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.
Examples
Input Arguments
Output Arguments
Extended Capabilities
Version History
Introduced in R2013b