| Products & Services | Industries | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
#include "matrix.h" mwIndex *mxGetIr(const mxArray *pm);
mwPointer mxGetIr(pm) mwPointer pm
Pointer to the first element in the ir array, if successful, and NULL in C (0 in Fortran) otherwise. Possible causes of failure include
Specifying a full (nonsparse) mxArray.
Specifying a value for pm that is NULL in C (0 in Fortran). This usually means that an earlier call to mxCreateSparse failed.
Use mxGetIr to obtain the starting address of the ir array. The ir array is an array of integers; the length of the ir array is typically nzmax values. For example, if nzmax equals 100, the ir array should contain 100 integers.
Each value in an ir array indicates a row (offset by 1) at which a nonzero element can be found. (The jc array is an index that indirectly specifies a column where nonzero elements can be found.)
For details on the ir and jc arrays, see mxSetIr and mxSetJc.
See fulltosparse.c in the matlabroot/extern/examples/refbook folder .
Additional examples:
explore.c in the matlabroot/extern/examples/mex folder
mxsetdimensions.c and mxsetnzmax.c in the matlabroot/extern/examples/mx folder
mxGetJc, mxGetNzmax, mxSetIr, mxSetJc, mxSetNzmax
![]() | mxGetInf (C and Fortran) | mxGetJc (C and Fortran) | ![]() |

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 |