| MATLAB Application Program Interface | Search  Help Desk |
| mxGetPi | Examples See Also |
Get an mxArray's imaginary data elements
C Syntax
#include "matrix.h" double *mxGetPi(const mxArray *array_ptr);
Arguments
array_ptrmxArray.
Returns
The imaginary data elements of the specifiedmxArray, on success. Returns NULL if there is no imaginary data or if there is an error.
Description
Thepi field points to an array containing the imaginary data of the mxArray. Call mxGetPi to get the contents of the pi field; that is, to get the starting address of this imaginary data.
The best way to determine if an mxArray is purely real is to call mxIsComplex.
The imaginary parts of all input matrices to a MATLAB function are allocated if any of the input matrices are complex.
Examples
Seeconvec.c, findnz.c, and fulltosparse.c in the refbook subdirectory of the examples directory.
For additional examples, see explore.c and mexcallmatlab.c in the mex subdirectory of the examples directory; see mxcalcsinglesubscript.c, mxgetinf.c, mxisfinite.c, and mxsetnzmax.c in the mx subdirectory of the examples directory.
See Also
mxGetPr, mxSetPi, mxSetPr