Skip to content

sprand

sparse · scripts/sparse/sprand.m

R = sprand (m, n, density)
R = sprand (m, n, density, rc)
R = sprand (S)

Random sparse matrix with entries uniformly distributed on (0,1).  With
rc the matrix has a prescribed reciprocal condition number (scalar) or
prescribed singular values (vector); with S it has the pattern of S.