| MATLAB Application Program Interface | Search  Help Desk |
| mexGetArrayPtr | Examples See Also |
Get a read-only pointer to a variable from another workspace
C Syntax
#include "mex.h" const mxArray *mexGetArrayPtr(const char *name, const char *workspace);
Arguments
namemxArray pointer.)
workspace
mexGetArrayPtr to search. The possible values are:Returns
A read-only pointermxArray called name on success. Returns NULL on failure.
Description
CallmexGetArrayPtr to get a read-only copy of the specified variable name into your MEX-file's workspace. This command is useful for examining an mxArray's data and characteristics, but useless for changing them. If you need to change data or characteristics, call mexGetArray instead of mexGetArrayPtr. If you simply need to examine data or characteristics, mexGetArrayPtr offers superior performance as the caller need pass only a pointer to the array. By contrast, mexGetArray passes back the entire array.
Example
Seemxislogical.c in the mx subdirectory of the examples directory.
See Also
mexGetArray