Read-only pointer to variable from another workspace
#include "mex.h" const mxArray *mexGetVariablePtr(const char *workspace, const char *varname);
#include "fintrf.h" mwPointer mexGetVariablePtr(workspace, varname) character*(*) workspace, varname
Call mexGetVariablePtr
to get a read-only
pointer to the specified variable, varname
, into
your MEX-file workspace. This command is useful for examining an mxArray
's
data and characteristics. If you want to change data or characteristics,
use mexGetVariable
(along with mexPutVariable
)
instead of mexGetVariablePtr
.
If you simply want to examine data or characteristics, mexGetVariablePtr
offers
superior performance because the caller wants to pass only a pointer
to the array.
If you use this function in Simulink® S-functions, do not store the resulting plhs
mxArray
pointers in any S-function block state that persists after the
MEX function finishes. Outputs of this function have temporary scope and are automatically
destroyed at the end of the MEX function call.