| Products & Services | Industries | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
#include "matrix.h" double *mxGetPi(const mxArray *pm);
mwPointer mxGetPi(pm) mwPointer pm
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.
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.
See convec.c, findnz.c, and fulltosparse.c in the matlabroot/extern/examples/refbook folder .
Additional examples:
explore.c and mexcallmatlab.c in the matlabroot/extern/examples/mex folder
mxcalcsinglesubscript.c, mxgetinf.c, mxisfinite.c, and mxsetnzmax.c in the matlabroot/extern/examples/mx folder
![]() | mxGetNzmax (C and Fortran) | mxGetPr (C and Fortran) | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |