s = spones(S)
| Parameter | Description |
|---|---|
| S | Sparse or 2D matrix. |
| Parameter | Description |
|---|---|
| S | a sparse matrix. |
s = spones(S) returns a matrix s with the same sparsity structure as S, but with one's in the nonzero positions.
S = sparse([1,0;3,4]);
R = spones(S)
| Version | Description |
|---|---|
| 1.0.0 | initial version |