Main Content

mxGetPi (Fortran)

(Not recommended) Imaginary data elements in mxDOUBLE_CLASS array

mxGetPi is not available in the interleaved complex API. Use mxGetComplexDoubles instead. For more information, see Compatibility Considerations.

Fortran Syntax

#include "fintrf.h"
mwPointer mxGetPi(pm)
mwPointer pm


When building MEX files using the separate complex API, call mxGetPi to get the contents of the pi field. pi is an array containing the imaginary data of the mxArray. Use mxGetPi on arrays of type mxDOUBLE_CLASS only. For other numeric mxArray types, use mxGetImagData.

Call mxIsDouble to validate the mxArray type. Call mxIsComplex to determine whether the data is complex.

If any of the input matrices to a function are complex, then MATLAB® allocates the imaginary parts of all input matrices.

Input Arguments

expand all

Pointer to a MATLAB array of type mxDOUBLE_CLASS, specified as mwPointer.

Complex Number Support: Yes

Output Arguments

expand all

Pointer to the first mxDouble element of the imaginary part of the data array within an mxArray, specified as mwPointer. The function returns 0 if no imaginary data exists or if an error occurs.

Complex Number Support: Yes

Version History

Introduced before R2006a

expand all