issparse
Test whether the input is a sparse matrix.
Syntax
Section titled “Syntax”tf = issparse(S)Description
Section titled “Description”Returns logical true when S is stored in sparse format, false otherwise. Useful for branching on representation when a function should specialize differently for sparse vs. full inputs.
Examples
Section titled “Examples”issparse(speye(5)) % 1issparse(eye(5)) % 0