| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
| On this page… |
|---|
Functions That Support Sparse Matrices |
Sparse matrix functions are located in the MATLAB sparfun directory. For a complete list, brief descriptions, and links to reference pages, type:
help sparfun
Sparse matrix functions fall into the following categories:
Function | Description |
|---|---|
Sparse identity matrix | |
Sparse uniformly distributed random matrix | |
Sparse normally distributed random matrix | |
Sparse random symmetric matrix | |
Sparse matrix formed from diagonals |
Function | Description |
|---|---|
Create sparse matrix | |
Convert sparse matrix to full matrix | |
Find indices of nonzero elements | |
Import from sparse matrix external format |
Function | Description |
|---|---|
Number of nonzero matrix elements | |
Nonzero matrix elements | |
Amount of storage allocated for nonzero matrix elements | |
Replace nonzero sparse matrix elements with ones | |
Allocate space for sparse matrix | |
True for sparse matrix | |
Apply function to nonzero matrix elements | |
Visualize sparsity pattern |
Function | Description |
|---|---|
Plot graph, as in "graph theory" | |
Elimination tree | |
Plot elimination tree | |
Lay out tree or forest | |
Plot picture of tree |
Function | Description |
|---|---|
Column approximate minimum degree permutation | |
Symmetric approximate minimum degree permutation | |
Symmetric reverse Cuthill-McKee permutation | |
Column permutation | |
Random permutation | |
Dulmage-Mendelsohn permutation |
Function | Description |
|---|---|
A few eigenvalues | |
A few singular values | |
Incomplete LU factorization | |
Incomplete LU factorization | |
Incomplete Cholesky factorization | |
Estimate the matrix 2-norm | |
1-norm condition number estimate | |
Structural rank |
Function | Description |
|---|---|
Biconjugate gradients method | |
Biconjugate gradients stabilized method | |
Biconjugate gradients stabilized(l) method | |
Conjugate gradients squared method | |
Generalized minimum residual method | |
Solve nonnegative least-squares constraints problem | |
LSQR method | |
Minimum residual method | |
Preconditioned conjugate gradients method | |
Quasi-minimal residual method | |
Transpose-free quasi-minimal residual method | |
Symmetric LQ method |
Function | Description |
|---|---|
Form least squares augmented system | |
Set parameters for sparse matrix routines | |
Symbolic factorization analysis |
These built-in functions do not accept sparse matrices as input. M-file functions that depend on these built-ins do not work with sparse matrices.
Function | Description |
|---|---|
Uniformly distributed pseudorandom numbers |
Function | Description |
|---|---|
Construct complex data from real and imaginary components |
Real Array Exponential Functions.
Function | Description |
|---|---|
Natural logarithm for nonnegative real arrays | |
Array power for real-only output | |
Square root for nonnegative real arrays |
Function | Description |
|---|---|
Bitwise AND | |
Bitwise complement | |
Bit at specified position | |
Maximum double-precision floating-point integer | |
Bitwise OR | |
Set bit at specified position | |
Shift bits specified number of places | |
Bitwise XOR |
Function | Description |
|---|---|
Hessenberg form of matrix | |
Eigenvalues of quasitriangular matrices | |
Reorder eigenvalues in QZ factorization | |
Reorder eigenvalues in Schur factorization | |
Schur decomposition | |
Singular value decomposition |
Function | Description |
|---|---|
Condition number with respect to inversion | |
Null space | |
Range space of matrix | |
Matrix reciprocal condition number estimate |
Function | Description |
|---|---|
Rank 1 update to Cholesky factorization | |
Generalized singular value decomposition | |
QZ factorization for generalized eigenvalues |
Function | Description |
|---|---|
Solve linear system of equations | |
Moore-Penrose pseudoinverse of matrix |
Function | Description |
|---|---|
Airy functions | |
Bessel function of third kind (Hankel function) | |
Modified Bessel function of first kind | |
Bessel function of first kind | |
Modified Bessel function of second kind | |
Bessel function of second kind | |
Error function | |
Error function | |
Error function | |
Gamma function | |
Gamma function | |
Psi (polygamma) function |
Function | Description |
|---|---|
2-D convolution | |
N-D convolution | |
1-D digital filter | |
2-D digital filter |
Function | Description |
|---|---|
Discrete Fourier transform | |
N-D discrete Fourier transform | |
Inverse discrete Fourier transform | |
N-D inverse discrete Fourier transform |
Function | Description |
|---|---|
Histogram count |
These functions do not accept sparse inputs, but you can use other functions in their place.
Function | Replacement Function Supporting Sparse Inputs |
|---|---|
Use condest instead. | |
Syntax d = eig(S) accepts a sparse symmetric matrix S. Otherwise, use eigs in place of eig. | |
norm(S,2) | Use normest for the 2-norm of a sparse matrix S. |
Use svds instead. |
![]() | Sparse Matrices | Computational Advantages | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |