Code covered by the BSD License  

Highlights from
whoislocked

from whoislocked by Rahul PN
Shows all m-files locked in memory during a Matlab session

whoislocked(varargin)
function mfileslocked = whoislocked(varargin)
% SYNTAX:
%   mfileslocked = whoislocked
%       Returns name of all locked m-files in memory as cell array
%
%   mfileslocked = whoislocked('full')
%       Returns name of all locked m-files in memory with full path name
%

% Initialize the output cell array
mfileslocked = {};

% Check for arguments and collect all m-file names in memory
if(nargin > 1)
    error('Too many input arguments');
elseif(nargin == 1)
    if(~strcmpi(varargin{1}, 'full'))
        error('Invalid argument passed');
    end
    mfiles = inmem('-completenames');
else
    mfiles = inmem;
end

% Check for the locked m-files in memory
for iCount = 1 : length(mfiles)
    if mislocked(mfiles{iCount})
        mfileslocked(end+1, :) = mfiles(iCount);
    end
end

Contact us at files@mathworks.com