| Contents | Index |
#include "matrix.h" void *mxGetData(const mxArray *pm);
mwPointer mxGetData(pm) mwPointer pm
Pointer to the first element of the real data. Returns NULL in C (0 in Fortran) if there is no real data.
In C, mxGetData returns a void pointer (void *). Since void pointers point to a value that has no type, you must cast the return value to the pointer type that matches the type specified by pm. To see how MATLAB types map to their equivalent C types, see the table on the mxClassID reference page.
In Fortran, to copy values from the returned pointer, use one of the mxCopyPtrTo* functions in the following manner:
C Get the data in mxArray, pm
mxCopyPtrToReal8(mxGetData(pm),data,
+ mxGetNumberOfElements(pm))See the following examples in matlabroot/extern/examples/mex.
See the following examples in matlabroot/extern/examples/refbook.
See the following examples in matlabroot/extern/examples/mx.
mxGetImagData, mxGetPr, mxClassID

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