MATLAB Application Program Interface | Search  Help Desk |
mxGetPi | See Also |
Get an mxArray's
imaginary data elements
integer*4 function mxGetPi(pm) integer*4 pmpm
mxArray
.
The imaginary data elements of the specified mxArray
, on success. Returns 0 if there is no imaginary data or if there is an error.
The pi
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 mxArrays
to a MATLAB function are allocated if any of the input mxArrays
is complex.
If you use mxGetPr
or mxGetPi
, note that mxFreeMatrix
frees pr
and pi
using mxFree
, so pr
and pi
should only be set to memory allocated with mxCalloc
.
mxGetPr
, mxSetPi
, mxSetPr