| MATLAB Application Program Interface | Search  Help Desk |
| mexLock | Examples See Also |
Lock a MEX-file so that it cannot be cleared from memory
C Syntax
#include "mex.h" void mexLock(void);
Description
By default, MEX-files are unlocked, meaning that a user can clear them at any time. CallmexLock to prohibit a MEX-file from being cleared.
To unlock a MEX-file, call mexUnlock.
mexLock increments a lock count. If you call mexLock n times, you must call mexUnlock n times to unlock your MEX-file.
Example
Seemexlock.c in the mex subdirectory of the examples directory.
See Also
mexIsLocked, mexMakeArrayPersistent, mexMakeMemoryPersistent, mexUnlock