issparse

Determines if an input is a matrix with sparse storage.

Syntax

b = issparse(a)

Inputs

a
Typically, a matrix input.
Type: double | complex|
Dimension: matrix

Outputs

b
The logical output, returning 1 for a sparse matrix.
Type: logical
Dimension: scalar

Example

m = [10,   0, 110,   0,  210, 260;
     20,   0,   0, 170, -220,   0;
      0,   0,   0, 180,  230,   0;
     40, -90,   0, 190,  240, 290;
      0,   0, 150,   0,    0,   0];
s = sparse(m);
b = issparse(m)
b = 0
c = issparse(s)
c = 1