R = sprandsym(S)
R = sprandsym(n,density)
R = sprandsym(n,density,rc)R = sprandsym(n
R = sprandsym(S)is a symmetric random matrix whose lower triangle and diagonal have the same structure as
S. Its elements are normally distributed, with mean 0 and variance 1.
R = sprandsym(n,density) is a symmetric random,
n, sparse matrix with approximately
n nonzeros; each entry is the sum of one or more normally distributed random samples, and
(0 <= density <= 1).
R = sprandsym(n,density,rc) has a reciprocal condition number equal to
rc. The distribution of entries is nonuniform; it is roughly symmetric about 0; all are in [-1,1].
rc is a vector of length
R has eigenvalues
rc. Thus, if
rc is a positive (nonnegative) vector then
R is a positive definite matrix. In either case,
R is generated by random Jacobi rotations applied to a diagonal matrix with the given eigenvalues or condition number. It has a great deal of topological and algebraic structure.
R = sprandsym(n,
kind) is positive definite, where
kind can be:
Rby random Jacobi rotation of a positive definite diagonal matrix.
Rhas the desired condition number exactly.
2to generate an
Rthat is a shifted sum of outer products.
Rhas the desired condition number only approximately, but has less structure.
3to generate an
Rthat has the same structure as the matrix
Sand approximate condition number
(c) Copyright 1994 by The MathWorks, Inc.