
315Explicit Parallelization Using MathWorks Toolboxes
A = pagefun(FUN,B,C,...)
[A,B,...] = pagefun(FUN,C,D,...)
The rst variant invokes a function with a handle FUN using pages of the arrays B, C,
and so on (with scalar expansion enabled). Any scalar dimensions of the input page are
virtually replicated to match the size of the other arrays in that dimension:
A(:,:,I,J,...) = FUN(B(:,:,I,J,...),C(:,:,I,J,...))
The second pagefun variant applies a function FUN that returns multiple outputs, that is,
gpuArrays A, B, and so on, each corresponding to one output argument of FUN. The func-
tion is applied using pages of input arrays C, D, and so ...