Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

mxGetPi (C and Fortran)

Imaginary data elements in array of type DOUBLE

C Syntax

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

Fortran Syntax

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

Arguments

pm

Pointer to an mxArray of type double

Returns

Pointer to the imaginary data elements of the specified mxArray, on success. Returns NULL in C (0 in Fortran) if there is no imaginary data or if there is an error.

Description

Use mxGetPi on arrays of type double only. Use mxIsDouble to validate the mxArray type. For other mxArray types, use mxGetImagData.

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 whether an mxArray is purely real is to call mxIsComplex.

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

Examples

See the following examples in matlabroot/extern/examples/refbook.

For Fortran examples, see:

See the following examples in matlabroot/extern/examples/mx.

See the following examples in matlabroot/extern/examples/mex.

Introduced before R2006a

Was this topic helpful?