Navigation

Operators and Keywords

Function List:

C++ API

: sprandn (m, n, d)
: sprandn (m, n, d, rc)
: sprandn (s)

Generate a sparse matrix with normally distributed random values.

The size of the matrix is mxn with a density of values d. d must be between 0 and 1. Values will be normally distributed with a mean of 0 and a variance of 1.

If called with a single matrix argument, a sparse matrix is generated with random values wherever the matrix s is nonzero.

If called with a scalar fourth argument rc, a random sparse matrix with reciprocal condition number rc is generated. If rc is a vector, then it specifies the first singular values of the generated matrix (length (rc) <= min (m, n)).

See also: sprand, sprandsym, randn.

Package: octave