mlock
Prevent clearing function or script from memory
Syntax
Description
mlock
locks the currently running function in memory. Locking a function preventsclear
from removing it from memory, and prevents reinitialization of anypersistent
variables defined in the file.
Usemlock
only within a MATLAB®code file.
To remove a locked function or script from memory, first unlock it using themunlock
command, and then use theclear
command.
Examples
Tips
To lock a MEX file, use the
mexLock
function.
See Also
Introduced before R2006a