Next: sprandn, Previous: spprod, Up: Function Reference
Generate a random sparse matrix. The size of the matrix will be m by n, with a density of values given by d. d should be between 0 and 1. Values will be uniformly distributed between 0 and 1.
Note: sometimes the actual density may be a bit smaller than d. This is unlikely to happen for large really sparse matrices.
If called with a single matrix argument, a random sparse matrix is generated wherever the matrix S is non-zero.
See also: sprandn.