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 (2024). 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
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.