mxGetPr (C and Fortran) - Get real data elements in mxArray

C Syntax

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

Fortran Syntax

mwPointer mxGetPr(pm)
mwPointer pm

Arguments

pm

Pointer to an mxArray

Returns

The address of the first element of the real data. Returns NULL in C (0 in Fortran) if there is no real data.

Description

Call mxGetPr to determine the starting address of the real data in the mxArray that pm points to. Once you have the starting address, you can access any other element in the mxArray.

C Examples

See convec.c, doubleelement.c, findnz.c, fulltosparse.c, sincall.c, timestwo.c, timestwoalt.c, and xtimesy.c in the refbook subdirectory of the examples directory.

See Also

mxGetPi, mxSetPi, mxSetPr

  


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