This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

mxGetPi (C)

Imaginary data elements in mxDOUBLE_CLASS array

mxGetPi is not recommended for C applications and is not available in the Interleaved Complex API. Use mxGetComplexDoubles instead of mxGetPr and mxGetPi. For more information, see Typed Data Access.

C Syntax

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


Call mxGetPi to get the contents of the pi field, 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 that the data is imaginary.

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 an mxDOUBLE_CLASS array.

Output Arguments

expand all

Pointer to the first mxDouble element of the imaginary part of the data. Returns NULL if there is no imaginary data or if there is an error.

Complex Number Support: Yes

API Version

This function is only available in the separate complex API. To build myMexFile.c using this function, type:

mex -R2017b myMexFile.c

MathWorks recommends that you upgrade your MEX file to use the Typed Data Access functions instead.

Introduced before R2006a