Documentation

gplus

Global addition

Syntax

S = gplus(X)
S = gplus(X,targetlab)

Description

S = gplus(X)returns the addition of the variant arrayXfrom each worker. The resultSis replicated on all workers.

S = gplus(X,targetlab)performs the addition, and places the result intoSonly on the worker indicated bytargetlab.Sis set to[]on all other workers.

Examples

With four workers,

S = gplus(labindex)

calculatesS = 1 + 2 + 3 + 4, and returns10on all four workers.

See Also

|

Introduced in R2006b

Was this topic helpful?