Prevent clearing function from memory
mlock locks the currently
running function in memory so that subsequent
do not remove it. Locking a function in memory also prevents any
persistent variables defined in the file
from getting reinitialized.
to return the file to its normal, clearable state.
testfun begins with an
function testfun mlock . .
When you execute this function, it becomes locked in memory.
You can check this using the
testfun mislocked('testfun') ans = 1
munlock, you unlock the
in memory. Checking its status with
that it is indeed unlocked at this point.
munlock('testfun') mislocked('testfun') ans = 0