R = sprandn(S)
R = sprandn(m,n,density)
| Parameter | Description |
|---|---|
| S | Input matrix |
| m | Number of rows |
| density | Density of the non-zero elements |
| Parameter | Description |
|---|---|
| S | a sparse matrix. |
R = sprandn(S) creates a sparse matrix that has the same sparsity pattern as the matrix S, but with normally distributed random entries.
R = sprandn(m,n,density) creates a random m-by-n sparse matrix with approximately density*m*n normally distributed nonzero entries for density in the interval [0,1].
S = [1 0 0; 0 1 0; 0 0 1]; R = sprandn(S)
R = sprandn(5, 5, 0.2)
| Version | Description |
|---|---|
| 1.15.0 | initial version |