munlock - Allow clearing function or script from memory - MATLAB (original) (raw)
Main Content
Allow clearing function or script from memory
Syntax
Description
munlock([fun](#d126e1150100))
unlocks the MATLABĀ® code file named fun
. A function that is locked using mlock
cannot be removed from memory with the clear
command unless you first unlock it using munlock
.
munlock
unlocks the currently running file. Use this syntax only within a MATLAB code file.
Examples
Create the function lockFun
in your current working folder.
function lockFun() mlock end
At the command prompt, call the lockFun
function. Check that the function is locked.
lockFun tf = mislocked('lockFun')
Unlock the function so it can be cleared from memory. Check that the function is not locked.
munlock('lockFun') tf = mislocked('lockFun')
Input Arguments
Name of function or script, specified as a character vector or a string scalar.
Tips
- To determine if a file is locked, use the mislocked function.
- To unlock a MEX file, use the mexUnlock function.
Version History
Introduced before R2006a