Main Content

mxIsSparse (C)

Determine whether input is sparse mxArray

C Syntax

#include "matrix.h"
bool mxIsSparse(const mxArray *pm);


mxIsSparse returns logical 1 (true) if pm points to a sparse mxArray. Otherwise, it returns logical 0 (false). Many routines (for example, mxGetIr and mxGetJc) require a sparse mxArray as input.

Input Arguments

expand all

Pointer to an mxArray array, specified as const mxArray*.


See these examples in matlabroot/extern/examples/refbook:

See these examples in matlabroot/extern/examples/mx:

Version History

Introduced before R2006a