Quantcast

Documentation Center

  • Trial Software
  • Product Updates

Contents

mexLock (C and Fortran)

Prevent clearing MEX-file from memory

C Syntax

#include "mex.h"
void mexLock(void);

Fortran Syntax

#include "fintrf.h"
subroutine mexLock()

Description

By default, MEX-files are unlocked, meaning you can clear them at any time. Call mexLock to prohibit clearing a MEX-file.

To unlock a MEX-file, you must call mexUnlock. Do not use the munlock function.

mexLock increments a lock count. If you call mexLock n times, call mexUnlock n times to unlock your MEX-file.

Examples

See the following examples in matlabroot/extern/examples/mex.

Was this topic helpful?