Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

munlock

Allow clearing functions from memory

Syntax

munlock
munlock fun
munlock(funName)

Description

munlock unlocks the currently running .m or .mex function in memory so that subsequent clear functions can remove it.

munlock fun unlocks the .m or .mex file named fun from memory. By default, these files are unlocked so that changes to the file are picked up. Calls to munlock are needed only to unlock .m or .mex functions that have been locked with mlock.

munlock(funName) is the function form of munlock. Specify funName as a character vector or string scalar.

Examples

The function testfun begins with an mlock statement.

function testfun
mlock
  .
  .

When you execute this function, it becomes locked in memory. You can check this using the mislocked function.

testfun

mislocked testfun
ans =
     1

Using munlock, you unlock the testfun function in memory. Checking its status with mislocked shows that it is indeed unlocked at this point.

munlock testfun

mislocked testfun
ans =
     0

Introduced before R2006a

Was this topic helpful?