Sparse symmetric random matrix
R = sprandsym(S)
R = sprandsym(n,density)
R = sprandsym(n,density,rc)
R = sprandsym(n,density,rc,kind)
R = sprandsym(S,,rc,3)
R = sprandsym(n,density) returns a symmetric random, n-by-n, sparse matrix with approximately density*n*n nonzeros; each entry is the sum of one or more normally distributed random samples, and (0 <= density <= 1).
If rc is a vector of length n, then R has eigenvalues rc. Thus, if rc is a positive (nonnegative) vector then R is a positive (nonnegative) 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.
If kind = 1, R is generated by random Jacobi rotation of a positive definite diagonal matrix. R has the desired condition number exactly.
If kind = 2, R is a shifted sum of outer products. R has the desired condition number only approximately, but has less structure.
R = sprandsym(S,,rc,3) has the same structure as the matrix S and approximate condition number 1/rc.