This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Create distributed sparse array of normally distributed pseudo-random values


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


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


Create a 1000-by-1000 sparse distributed double array DS with approximately 1000 nonzeros.

DS = distributed.sprandn(1000,1000,0.001);


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

Introduced in R2009b

Was this topic helpful?