mxGetPi (C and Fortran) - Get imaginary data elements in mxArray

C Syntax

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

Fortran Syntax

mwPointer mxGetPi(pm)
mwPointer pm

Arguments

pm

Pointer to an mxArray

Returns

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

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.

The imaginary parts of all input matrices to a MATLAB function are allocated if any of the input matrices are complex.

C Examples

See convec.c, findnz.c, and fulltosparse.c in the refbook subdirectory of the examples directory.

Additional examples:

See Also

mxGetPr, mxSetPi, mxSetPr

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS