| 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 |
DS = distributed.sprand(m, n, density)
DS = distributed.sprand(m, n, density) creates an m-by-n sparse distributed array with approximately density*m*n uniformly distributed nonzero double entries.
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.
Create a 1000-by-1000 sparse distributed double array DS with approximately 1000 nonzeros.
DS = distributed.sprand(1000, 1000, .001);
sprand MATLAB function reference page
codistributed.sprand, distributed.rand, distributed.randn, sparse, distributed.speye, distributed.sprandn
![]() | distributed.speye | distributed.sprandn | ![]() |

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 |