MATLAB Application Program Interface Reference | Help Desk |
mxIsFromGlobalWS
True if themxArray
was copied from MATLAB's global workspace
#include "matrix.h" bool mxIsFromGlobalWS(const mxArray *array_ptr);array_ptr
true
if the array was copied out of the global workspace; otherwise, returns false
.
mxIsFromGlobalWS is useful for stand-alone mat and engine programs. mexIsGlobal tells you if the pointer you pass actually points into the global workspace.
bool f; . . . f = mexIsGlobal(prhs[0]); if (f) { other_array = mxDuplicateArray(prhs[0]); f = mxIsFromGlobalWS(other_array); if (f) mexPrintf("The copy was made from the global WS."); else mexPrintf("The copy was not made from the global WS."); }
mexIsGlobal