Skip to Main Content Skip to Search
Product Documentation

codistributed.cell - Create codistributed cell array

Syntax

C = codistributed.cell(n)
C = codistributed.cell(m, n, p, ...)
C = codistributed.cell([m, n, p, ...])
C = cell(n, codist)
C = cell(m, n, p, ..., codist)
C = cell([m, n, p, ...], codist)

Description

C = codistributed.cell(n) creates an n-by-n codistributed array of underlying class cell, distributing along columns.

C = codistributed.cell(m, n, p, ...) or C = codistributed.cell([m, n, p, ...]) creates an m-by-n-by-p-by-... codistributed array of underlying class cell, using a default scheme of distributing along the last nonsingleton dimension.

Optional arguments to codistributed.cell must be specified after the required arguments, and in the following order:

C = cell(n, codist) is the same as C = codistributed.cell(n, codist). You can also use the 'noCommunication' object with this syntax. To use the default distribution scheme, specify a codistributor constructor without arguments. For example:

spmd
    C = cell(8, codistributor1d());
end

C = cell(m, n, p, ..., codist) and C = cell([m, n, p, ...], codist) are the same as C = codistributed.cell(m, n, p, ...) and C = codistributed.cell([m, n, p, ...]), respectively. You can also use the optional 'noCommunication' argument with this syntax.

Examples

With four labs,

spmd(4)
    C = codistributed.cell(1000);
end

creates a 1000-by-1000 distributed cell array C, distributed by its second dimension (columns). Each lab contains a 1000-by-250 local piece of C.

spmd(4)
    codist = codistributor1d(2, 1:numlabs);
    C = cell(10, 10, codist);
end

creates a 10-by-10 codistributed cell array C, distributed by its columns. Each lab contains a 10-by-labindex local piece of C.

See Also

cell | distributed.cell

  


Free Parallel Computing Interactive Kit

See how to solve large problems with minimal effort and reduce simulation time.

Get free kit

Trials Available

Try the latest versions of parallel computing products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS