This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Global addition


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


S = gplus(X) returns the addition of the variant array X from each worker. The result S is replicated on all workers.

S = gplus(X,targetlab) performs the addition, and places the result into S only on the worker indicated by targetlab. S is set to [] on all other workers.


With four workers,

S = gplus(labindex)

calculates S = 1 + 2 + 3 + 4, and returns 10 on all four workers.

See Also


Introduced in R2006b