Sometimes you accidentally enter
which then, inadvertently, also clears the contents of all displayed objects, which makes Matlab (due to the GUI's callbacks) go haywire and spit out tons of errors and warnings.
To get a true fresh start, you first need to close the GUI (without invoking any further callbacks). To do so, enter
% get a handle to the xfigure class (default constructor) xfig = xfigure; % then delete all objects without further ado xfig.DeleteAllFigures; % and *then* get a fresh start clear classes;