MATLAB Application Program Interface Reference Help Desk

mxGetPi

Purpose

Get an mxArray's imaginary data elements

C Syntax

Arguments

array_ptr

Pointer to an mxArray.

Returns

The imaginary data elements of the specified mxArray, on success. Returns NULL 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 matrices to a MATLAB function are allocated if any of the input matrices are complex.

Examples

Consider a MEX-file named MyImag that displays the contents of the imaginary component of the {3, 1, 2} element of a three-dimensional mxArray

In MATLAB, create a three-dimensional mxArray named t containing imaginary data parts:

Call MyImag, passing t as an argument

For an additional example, see mxGetPi.c in the mx subdirectory of the examples directory.

See Also

mxGetPr, mxSetPi, mxSetPr



[ Previous | Help Desk | Next ]