MATLAB: How to determine if the Simulink Library Browser has been opened any time in the current session of MATLAB 7.6 (R2008a)

classesfilesfunctioninmemm-fileMATLABmemorymexopen

I would like to find out if the Simulink Browser has been opened in the current session of MATLAB.

Best Answer

When the Simulink Library Browser is opened, the 'libbrowse2.m' function is called. You can use the INMEM function to determine if the Simulink Library Browser has been opened before in the current session.
temp = inmem; %get a cell array of program files,Mex files,Java classes in memory
cmp = strcmp(temp,'libbrowse2'); %Compare each item of the cell array with the constant 'libbrowse2'
if any(cmp) %find if a match is present
disp('Simulink browser has been opened');
else
disp('Siimulink browser not opened before in this session')
end