inmem

Lists the functions currently loaded in memory.

Category: Software Development Tools > Performance and Memory

Syntax

M = inmem

Returns the names of the loaded M-file functions as a cell array of character vectors.

[M, X, J] = inmem

Also returns the loaded MEX files X and Java classes J.

Description

MATLAB loads a function file the first time it is called and keeps it in memory. inmem reports what is there, which helps explain why persistent variables survive between calls or why a file edit has no effect until clear is run.

The content of the list depends on what has already run in the session, so it is not stable from one session to another.

Output arguments

M
Cell array of function names.
X
Cell array of MEX file names.
J
Cell array of Java class names.

Example

Result types

[M, X, J] = inmem;
disp(class(M))
disp(class(X))
disp(class(J))
Output
cell
cell
cell

See also

clear which exist mlock