28.12.2012 Views

Figure Properties - SERC

Figure Properties - SERC

Figure Properties - SERC

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

mlock<br />

2mlock<br />

Purpose Prevent M-file or MEX-file clearing<br />

Syntax mlock<br />

Description mlock locks the currently running M-file or MEX-file in memory so that<br />

subsequent clear functions do not remove it.<br />

2-1478<br />

Use the munlock function to return the file to its normal, clearable state.<br />

Locking an M-file or MEX-file in memory also prevents any persistent<br />

variables defined in the file from getting reinitialized.<br />

Examples The function testfun begins with an mlock statement.<br />

function testfun<br />

mlock<br />

.<br />

.<br />

When you execute this function, it becomes locked in memory. You can check<br />

this using the mislocked function.<br />

testfun<br />

mislocked('testfun')<br />

ans =<br />

1<br />

Using munlock, you unlock the testfun function in memory. Checking its<br />

status with mislocked shows that it is indeed unlocked at this point.<br />

munlock('testfun')<br />

mislocked('testfun')<br />

ans =<br />

0<br />

See Also mislocked, munlock, persistent

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!