External Interfaces/API Reference | ![]() ![]() |
Get an mxArray's
imaginary data elements
Fortran Syntax
integer*4 function mxGetPi(pm) integer*4 pm
Arguments
pm
Pointer to an mxArray
.
Returns
The imaginary data elements of the specified mxArray
, on success. Returns 0 if there is no imaginary data or if there is an error.
Description
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
.
See Also
![]() | mxGetNzmax | mxGetPr | ![]() |