issparse

Purpose

Check for sparse matrix storage class.

Synopsis

k = issparse(X)

Description

issparse(X) returns 1 if the storage class of X is sparse and 0 otherwise. Since most of MATLAB's functions work correctly and efficiently with both sparse and full matrices, issparse(X) is not needed very often.

Examples

if issparse(X)
    nrm = normest(X);
else
    nrm = norm(X);
end

See Also

full, sparse

(c) Copyright 1994 by The MathWorks, Inc.