Skip to Main Content Skip to Search
Product Documentation

codistributed.NaN - Create codistributed array of Not-a-Number values

Syntax

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

Description

C = codistributed.NaN(n) creates an n-by-n codistributed matrix of NaN values.

C = codistributed.NaN(m, n, ...) or C = codistributed.NaN([m, n, ...]) creates an m-by-n-by-... codistributed array of NaN values.

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

C = NaN(n, codist) is the same as C = codistributed.NaN(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
    C = NaN(8, codistributor1d());
end

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

Examples

With four labs,

spmd(4)
    C = NaN(1000, codistributor())
end

creates a 1000-by-1000 codistributed double matrix C of NaN values, distributed by its second dimension (columns). Each lab contains a 1000-by-250 local piece of C.

spmd(4)
    codist = codistributor('1d', 2, 1:numlabs);
    C = NaN(10, 10, 'single', codist);
end

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

See Also

codistributed.Inf | distributed.NaN | NaN

  


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