gplus
Global addition
Syntax
S = gplus(X)
S = gplus(X,targetlab)
Description
S = gplus(X)
returns the addition of the variant arrayX
from each worker. The resultS
is replicated on all workers.
S = gplus(X,targetlab)
performs the addition, and places the result intoS
only on the worker indicated bytargetlab
.S
is set to[]
on all other workers.
Examples
With four workers,
S = gplus(labindex)
calculatesS = 1 + 2 + 3 + 4
, and returns10
on all four workers.
Introduced in R2006b
Was this topic helpful?