External Interfaces Reference |
Get read-only pointer to variable from another workspace
C Syntax
Arguments
workspace
Specifies which workspace you want mexGetVariablePtr
to search. The possible values are:
base |
Search for the variable in the base workspace |
caller |
Search for the variable in the caller's workspace |
global |
Search for the variable in the global workspace |
var_name
Name of a variable in another workspace. (Note that this is a variable name, not an mxArray
pointer.)
Returns
A read-only pointer to the mxArray
on success. Returns NULL
on failure.
Description
Call mexGetVariablePtr
to get a read-only pointer to the specified variable, var_name
, into your MEX-file's workspace. This command is useful for examining an mxArray's
data and characteristics. If you need to change data or characteristics, use mexGetVariable
(along with mexPutVariable
) instead of mexGetVariablePtr
.
If you simply need to examine data or characteristics, mexGetVariablePtr
offers superior performance as the caller need pass only a pointer to the array.
Examples
See mxislogical.c
in the mx
subdirectory of the examples
directory.
See Also
mexGetVariable | mexIsFinite (Obsolete) |
© 1994-2005 The MathWorks, Inc.