tomwalters@0: % support file for 'aim-mat' tomwalters@0: % tomwalters@0: % This external file is included as part of the 'aim-mat' distribution package bleeck@3: % (c) 2011, University of Southampton bleeck@3: % Maintained by Stefan Bleeck (bleeck@gmail.com) bleeck@3: % download of current version is on the soundsoftware site: bleeck@3: % http://code.soundsoftware.ac.uk/projects/aimmat bleeck@3: % documentation and everything is on http://www.acousticscale.org bleeck@3: tomwalters@0: tomwalters@0: function ca(namearg) tomwalters@0: % function ca('name'): close all open graphic windows that dont contain 'name' in their title tomwalters@0: tomwalters@0: if nargin==0 tomwalters@0: namearg='browser'; tomwalters@0: % namearg{2}='aim-mat'; tomwalters@0: end tomwalters@0: tomwalters@0: if ~iscell(namearg) tomwalters@0: if ~ischar(namearg) tomwalters@0: disp('ca only works with strings as input') tomwalters@0: else tomwalters@0: name{1}=namearg; tomwalters@0: end tomwalters@0: % else tomwalters@0: % name=namearg; tomwalters@0: end tomwalters@0: tomwalters@0: tomwalters@0: tomwalters@0: tomwalters@0: all_windows=get(0,'children'); % is not identic to: tomwalters@0: all_windows=allchild(0); tomwalters@0: for i=1:length(all_windows) tomwalters@0: if strcmp(get(all_windows(i),'type'),'figure'); tomwalters@0: titl=get(all_windows(i),'name'); tomwalters@0: can_be_cleared=1; tomwalters@0: for j=1:length(name) tomwalters@0: if ~isempty(strfind(titl,name{j})) tomwalters@0: can_be_cleared=0; tomwalters@0: end tomwalters@0: end tomwalters@0: if can_be_cleared tomwalters@0: % set(0,'ShowHiddenHandles','on') tomwalters@0: close(all_windows(i)); tomwalters@0: end tomwalters@0: end tomwalters@0: end