CSR sparse matrix

Work with sparse matrices using CSR matrix format to significantly improve performance of matrix-vector multiplications.
6 Downloads
Updated 18 Jun 2025

View License

Sparse matrix class emulating the CSR matrix format by internaly storing A.'.
This class can singificantly improve the performance of your application when the code is dominated by matrix-vector multiplcations.
Usage: Create a sparseCSR matrix using the syntax
A = sparseCSR();
A = sparseCSR(B);
A = sparseCSR(N, M);
A = sparseCSR(I, J, V);
A = sparseCSR(I, J, V, N, M);
where B can be either a full or a sparse matrix, N, M are the number of rows and columns, and I, J, and V are the row, column, and value vectors of A.
Convert a sparseCSR matrix using sparse(A) or full(A) into a sparse or dense matrix.
Several functions are overloaded aiming to naively use a sparseCSR matrix instead of a sparse matrix.

Cite As

Christoph Lohmann (2026). CSR sparse matrix (https://www.mathworks.com/matlabcentral/fileexchange/181316-csr-sparse-matrix), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2025a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags
Version Published Release Notes
1.0.0