spalloc
Create a sparse matrix with allocated storage.
📝Syntax
S = spalloc(m, n, nz)
📥Input Arguments
Parameter Description
m number of rows.
n number of columns.
nz requested storage allocation for nonzero elements.
📤Output Arguments
Parameter Description
S a sparse double matrix.
📄Description

spalloc creates an m-by-n sparse double matrix and reserves storage for up to nz nonzero elements.

💡Examples
S = spalloc(3, 4, 5)
nzmax(S)
🔗See Also
sparsenzmax
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub