Products & Services Solutions Academia Support User Community Company

Learn more about Parallel Computing Toolbox   

codistributed.true - Create codistributed true array

Syntax

T = codistributed.true(n)
T = codistributed.true(m, n, ...)
T = codistributed.true([m, n, ...])
T = true(n, codist)
T = true(m, n, ..., codist)
T = true([m, n, ...], codist)

Description

T = codistributed.true(n) creates an n-by-n codistributed array of logical ones.

T = codistributed.true(m, n, ...) or T = codistributed.true([m, n, ...]) creates an m-by-n-by-... codistributed array of logical ones.

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

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

spmd
    T = true(8, codistributor1d());
end

T = true(m, n, ..., codist) and T = true([m, n, ...], codist) are the same as T = codistributed.true(m, n, ...) and T = codistributed.true([m, n, ...]), respectively. You can also use the optional arguments with this syntax.

Examples

With four labs,

spmd(4)
    T = true(1000, codistributor());
end

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

spmd(4)
    codist = codistributor('1d', 2, 1:numlabs);
    T = true(10, 10, codist);
end

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

See Also

true MATLAB function reference page

codistributed.false, distributed.true

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS