Products & Services Solutions Academia Support User Community Company

Learn more about Parallel Computing Toolbox   

distributed.sprand - Create distributed sparse array of uniformly distributed pseudo-random values

Syntax

DS = distributed.sprand(m, n, density)

Description

DS = distributed.sprand(m, n, density) creates an m-by-n sparse distributed array with approximately density*m*n uniformly distributed nonzero double entries.

Remarks

When you use sprand 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 sparse distributed double array DS with approximately 1000 nonzeros.

DS = distributed.sprand(1000, 1000, .001);

See Also

sprand MATLAB function reference page

codistributed.sprand, distributed.rand, distributed.randn, sparse, distributed.speye, 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