inmem - Names of functions, MEX files, and classes in memory - MATLAB (original) (raw)
Names of functions, MEX files, and classes in memory
Syntax
Description
[[F](#mw%5F8613c153-e501-4b56-8fa9-4af0974bd22b),[M](#mw%5F4cca1762-7213-40e7-8eb9-85bb92e18ae3),[C](#mw%5Fd9f822f5-4a09-4feb-87b9-30679e19d7cd)] = inmem
returns the names of the functions, MEX files, and classes that are currently loaded.
[[F](#mw%5F8613c153-e501-4b56-8fa9-4af0974bd22b),[M](#mw%5F4cca1762-7213-40e7-8eb9-85bb92e18ae3),[C](#mw%5Fd9f822f5-4a09-4feb-87b9-30679e19d7cd)] = inmem("-completenames")
returns the full names of the functions and MEX files in memory, including the file path and extension. For classes, the function behaves the same as in the previous syntax.
Examples
List the functions that remain in memory after running your code.
Clear the memory, and then call the magic
function.
clear all X = magic(100);
Return the list of functions that are currently loaded. Verify that the list includes magic
.
F = inmem; ismember("magic",F)
Call the MEX function arrayProduct
, and then verify that the function is in memory. You must have a supported C compiler installed on your system to run this example.
Clear the memory. Then, copy the source code example from the examples
folder.
clear all copyfile(fullfile(matlabroot,"extern","examples","mex","arrayProduct.c"),".","f")
Build the MEX file and test it. The output displays information specific to your compiler.
mex arrayProduct.c s = 5; A = [1.5 2 9]; B = arrayProduct(s,A)
Building with 'Microsoft Visual C++ 2019 (C)'. MEX completed successfully.
B =
7.5000 10.0000 45.0000
Return the list of MEX files that are currently loaded. Verify that the list includes arrayProduct
.
[F1,M1] = inmem; ismember("arrayProduct",M1)
Now, return the full names of the MEX files, including the file path and extension. The output displays arrayProduct
in your current folder.
[F2,M2] = inmem("-completenames"); M2
M2 =
1×1 cell array
{'C:\work\MyExamples\arrayProduct.mexw64'}
Output Arguments
Names of the functions in memory, returned as a cell array of character vectors. If you call inmem
with "-completenames"
, the returned values are full names including the file path and extension.
Names of the MEX files in memory, returned as a cell array of character vectors. If you call inmem
with "-completenames"
, the returned values are full names including the file path and extension.
Names of the classes in memory, returned as a cell array of character vectors. The returned values are the same whether or not you call inmem
with"-completenames"
.
Tips
- If you call
inmem
with any text input other than"-completenames"
, it behaves as if it were called with no input.
Extended Capabilities
Version History
Introduced before R2006a