Skip to content

sprandn

Sparse standard-normal random matrix.

S = sprandn(m, n, density)
S = sprandn(m, n, density, rc)
S = sprandn(A)

Same shape conventions as sprand, but draws non-zero entries from the standard normal distribution N(0, 1) instead of uniform.

sprandn(50, 50, 0.1) % 50×50 sparse, ~250 N(0,1) entries
  • sprand — Sparse uniform random matrix.
  • randn — Standard-normal random numbers (mean 0, variance 1).
  • sparse — Create a sparse matrix.