Main Content

mxGetPi (C)

(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 Version History.

C Syntax

#include "matrix.h"
mxDouble *mxGetPi(const mxArray *pm);

Description

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 mxArray *.

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 mxDouble *. The function returns NULL if no imaginary data exists or if an error occurs.

Complex Number Support: Yes

Version History

Introduced before R2006a

expand all