matlab mxgetdata函数语法

发表matlab mxgetdata函数相关文章
一句话说明: Pointer to real numeric data elements in array

mxGetData (C and Fortran)

Pointer to real numeric data elements in array

C Syntax

#include "matrix.h"
void *mxGetData(const mxArray *pm);

Fortran Syntax

mwPointer mxGetData(pm)
mwPointer pm



Pointer to an mxArray


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
     +                  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.

See Also

mxGetImagData, mxGetPr, mxClassID


与matlab mxgetdata用法相关的文章

友情链接It题库(| 版权归yishouce.com所有| 友链等可联系|粤ICP备16001685号-1