MATLAB: Am I unable to delete MEX functions from memory using the CLEAR MEX command

MATLAB

I am using MEX functions in my MATLAB code. However, when I try to clear the functions from MATLAB's memory using CLEAR MEX, I still see them using the INMEM function.

Best Answer

This will occur if the MEX code has memory leaks. To resolve this issue, debug the MEX code and be sure there are no memory leaks.
For more information about debugging MEX files, see the technical note 1605:
<http://www.mathworks.com/support/tech-notes/1600/1605.html>