| MATLAB Application Program Interface | Search  Help Desk |
| mexIsGlobal | Examples See Also |
True if mxArray has global scope
C Syntax
#include "matrix.h" bool mexIsGlobal(const mxArray *array_ptr);
Arguments
array_ptrmxArray.
Returns
True if the mxArray has global scope; otherwise, returns false.
Description
UsemexIsGlobal 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.
Example
Seemxislogical.c in the mx subdirectory of the examples directory.
See Also
mexGetArray, mexGetArrayPtr, mexPutArray