MATLAB: Am I unable to clear all classes in MATLAB 7.7 (R2008b) when I have an object of the class ‘tsguis.tsviewer’

MATLABmcosoop

When I try to clear objects of the class "tsguis.tsviewer" as follows:
a = tsguis.tsviewer;
clear all;
clear classes;
I get the following warning message:
Warning: Objects of tsguis.tsviewer class exist – not clearing this class or any of its super-classes

Best Answer

This is intended behavior. MATLAB needs to keep a persistent reference to 'tsviewer' for performance reasons when reopening TSTOOL. MLOCK is used to prevent "clear all" from clearing these objects.
To work around the issue one can unlock the class and then clear the objects.
munlock tsviewer
clear classes