External Interfaces/API Reference | ![]() ![]() |
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
name
Name of a variable in another workspace. (Note that this is a variable name, not an mxArray
pointer.)
workspace
mexGetArrayPtr
to search. The possible values are:Returns
A read-only pointer mxArray
called name
on success. Returns NULL
on failure.
Description
Call mexGetArrayPtr
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
See mxislogical.c
in the mx
subdirectory of the examples
directory.
See Also
![]() | mexGetArray | mexGetEps (Obsolete) | ![]() |