Rank: 1376 based on 78 downloads (last 30 days) and 3 files submitted
photo

Karl

E-mail

Personal Profile:

Professional Interests:

 

Watch this Author's files

 

Files Posted by Karl View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
27 Aug 2009 Screenshot Add 'cab' button to figure Add a 'cab' button to a figure which, when clicked, closes all figures except the current one. Author: Karl close, plot, cab, figure, close all 10 0
22 Jun 2009 Text input with default Like Matlab's "input" function, but with a default that you can select by simply hitting Enter. Author: Karl default, input, command line 13 0
22 Jun 2009 Close all figures except those listed Close all figures except those listed by the user. Author: Karl figure, gui 55 7
  • 5.0
5.0 | 5 ratings
Comments and Ratings by Karl View all
Updated File Comments Rating
24 Jun 2009 Close all figures except those listed Close all figures except those listed by the user. Author: Karl

Thanks for the improvement, Thierry! The 'cellfun(@fcn, ...)' method, though elegant, unfortunately doesn't work on Matlab 6.x (which some of us still have to use. Sigh.)

06 Jun 2009 Surface Fitting using gridfit Model 2-d surfaces from scattered data Author: John D'Errico

This is spectacular. I hope the Mathworks is paying you some sort of royalty for your efforts!

04 Jun 2009 cprintf - display formatted colored text in the Command Window Displays sprintf-formatted strings in the Command Window using the specified color/underline style Author: Yair Altman

This is great! I wish Matlab documented its Java innards better. Anyway, there seems to be another small bug.

fprintf('Here: ')
cprintf('blue', 'Blue\n');

results in a blue underscore followed by the word 'Blue' in white (invisible on white background of my command window - but shows up when highlighted).

However, the same code as above, only using '-blue' instead of 'blue', works fine (gives the expected underlined blue text).

I'm using Matlab 2007b on a Linux box.

Comments and Ratings on Karl's Files View all
Updated File Comment by Comments Rating
02 Oct 2009 Close all figures except those listed Close all figures except those listed by the user. Author: Karl Chamane

Excellent code! Thanks

24 Jun 2009 Close all figures except those listed Close all figures except those listed by the user. Author: Karl Karl

Thanks for the improvement, Thierry! The 'cellfun(@fcn, ...)' method, though elegant, unfortunately doesn't work on Matlab 6.x (which some of us still have to use. Sigh.)

24 Jun 2009 Close all figures except those listed Close all figures except those listed by the user. Author: Karl Jan

Very handy indeed. And nice tweak, Thierry

24 Jun 2009 Close all figures except those listed Close all figures except those listed by the user. Author: Karl Dalon, Thierry

Good idea!
I prefer to use 0 for gcf or 'last' option.
I've modified the function like this:
function cab(varargin)
% CAB close all but
% This function closes all figures currently open EXCEPT for
% those listed as arguments. 'cab' stands for 'close all but'.
%
% SYNTAX:
% CAB figure_handle1 figure_handle2 ... (command line syntax)
% CAB(figure_handle1, figure_handle2, ...)
% Use 0 for gcf. CAB 0 closes all figures except current one.
% CAB : same as close all
%
if nargin==0,
    close all;
    return
end

% all_figs = findall(0, 'type', 'figure'); % Uncomment this to include ALL windows, including those with hidden handles (e.g. GUIs)
all_figs = findobj(0, 'type', 'figure');

if iscellstr(varargin) % command line syntax
    figs2keep=cellfun(@str2double,varargin);
else
    figs2keep=[varargin{:}];
end
figs2keep(figs2keep==0)=gcf;
delete(setdiff(all_figs, figs2keep)

22 Jun 2009 Close all figures except those listed Close all figures except those listed by the user. Author: Karl Queffurust, Aurelien

A fantastic short code to save time ! Thanks for this submission!

Top Tags Applied by Karl
figure, cab, close, close all, command line
Files Tagged by Karl View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
27 Aug 2009 Screenshot Add 'cab' button to figure Add a 'cab' button to a figure which, when clicked, closes all figures except the current one. Author: Karl close, plot, cab, figure, close all 10 0
22 Jun 2009 Text input with default Like Matlab's "input" function, but with a default that you can select by simply hitting Enter. Author: Karl default, input, command line 13 0
22 Jun 2009 Close all figures except those listed Close all figures except those listed by the user. Author: Karl figure, gui 55 7
  • 5.0
5.0 | 5 ratings
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com