This utility can be useful when you need to update a sparse matrix values
without changing its sparsity pattern.
Since MATLAB uses CSC (Compressed Sparse Column) format for sparse matries, the non-zeroes are stored in an array, which can be safely overwritten in order to update the matrix, while preserving the sparsity pattern.
This can be done much faster than re-allocating the whole sparse matrix again, when only its values change.
The source code can be found at GitHub:
https://github.com/romanz/thesis/tree/master/utils/spinit
Cite As
Roman (2026). SPINIT (https://www.mathworks.com/matlabcentral/fileexchange/30293-spinit), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > Mathematics > Sparse Matrices >
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
