Products & Services Solutions Academia Support User Community Company

Learn more about Parallel Computing Toolbox   

distributed.rand - Create distributed array of uniformly distributed pseudo-random numbers

Syntax

R = distributed.rand(n)
R = distributed.rand(m, n, ...)
R = distributed.rand([m, n, ...])
R = distributed.rand(..., classname)

Description

R = distributed.rand(n) creates an n-by-n codistributed array of underlying class double.

R = distributed.rand(m, n, ...) or R = distributed.rand([m, n, ...]) creates an m-by-n-by-... distributed array of underlying class double.

R = distributed.rand(..., classname) specifies the class of the distributed array R. Valid choices are the same as for the regular rand function: 'double' (the default), 'single', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', and 'uint64'.

Remarks

When you use rand on the workers in the MATLAB pool, or in a distributed or parallel job (including pmode), each worker or lab sets its random generator seed to a value that depends only on the lab index or task ID. Therefore, the array on each lab is unique for that job. However, if you repeat the job, you get the same random data.

Examples

Create a 1000-by-1000 distributed matrix of random values of class double:

R = distributed.rand(1000);

See Also

rand MATLAB function reference page

codistributed.rand, distributed.randn, distributed.sprand, distributed.sprandn

  


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