| MATLAB Application Program Interface | Search  Help Desk |
| mexIsGlobal | Examples See Also |
True if mxArray has global scope
#include "matrix.h" bool mexIsGlobal(const mxArray *array_ptr);array_ptr
mxArray.
true if the mxArray has global scope; otherwise, returns false.
Use mexIsGlobal to determine if the specified mxArray has global scope.
By default, mxArrays have local scope, meaning that changes made to the mxArray inside a MEX-file or stand-alone application have no effect on a variable of the same name in another workspace. However, if an mxArray has global scope, then changes made to the mxArray inside a MEX-file or stand-alone application can affect other workspaces.
The MATLAB global command gives global scope to a MATLAB variable. For example, to make variable x global, just type
>> global xThe most common use of
mexIsGlobal is to determine if an mxArray stored inside a MAT-files is global.
See mexisglobal.c in the mex subdirectory of the examples directory.
mexGetArray, mexGetArrayPtr, mexPutArray