| MATLAB Application Program Interface | Search  Help Desk |
| mexGetArray | Examples See Also |
Get a copy of a variable from another workspace
C Syntax
#include "mex.h" mxArray *mexGetArray(const char *name, const char *workspace);
Arguments
namemexGetArray should search in order to find variable name. The possible values are:Returns
A copy of themxArray on success. Returns NULL on failure. A common cause of failure is specifying a name not currently in the workspace. Perhaps the variable was in the workspace at one time but has since been cleared.
Description
CallmexGetArray to copy the specified variable name into your MEX-file's workspace. Once inside your MEX-file's workspace, your MEX-file may examine or modify the variable's data and characteristics.
The returned mxArray contains a copy of all the data and characteristics that variable name had in the other workspace. mexGetArray initializes the name field of the returned mxArray to the variable name.
Example
Seemexgetarray.c in the mex subdirectory of the examples directory.
See Also
mexGetArrayPtr, mexPutArray