| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Parallel Computing Toolbox |
| Contents | Index |
| Learn more about Parallel Computing Toolbox |
R = distributed.rand(n)
R = distributed.rand(m, n, ...)
R
= distributed.rand([m, n, ...])
R = distributed.rand(..., classname)
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'.
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.
Create a 1000-by-1000 distributed matrix of random values of class double:
R = distributed.rand(1000);
rand MATLAB function reference page
codistributed.rand, distributed.randn, distributed.sprand, distributed.sprandn
![]() | distributed.ones | distributed.randn | ![]() |

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 |