Navigation

Operators and Keywords

Function List:

C++ API

: sprandsym (n, d)
: sprandsym (s)

Generate a symmetric random sparse matrix.

The size of the matrix will be nxn, with a density of values given by d. d must be between 0 and 1 inclusive. Values will be normally distributed with a mean of zero and a variance of 1.

If called with a single matrix argument, a random sparse matrix is generated wherever the matrix s is nonzero in its lower triangular part.

See also: sprand, sprandn, spones, sparse.

Package: octave