Rank: 934 based on 125 downloads (last 30 days) and 1 file submitted
photo

David Yang

E-mail

Personal Profile:

Professional Interests:

 

Watch this Author's files

 

Files Posted by David
Updated   File Tags Downloads
(last 30 days)
Comments Rating
10 Aug 1999 keep KEEP is complementary to the "clear" command: it keeps the supplied variables and deletes the rest. Author: David Yang clear variables, keep complementary, tools, utilities 125 36
  • 4.94737
4.9 | 38 ratings
Comments and Ratings on David's Files View all
Updated File Comment by Comments Rating
30 Sep 2009 keep KEEP is complementary to the "clear" command: it keeps the supplied variables and deletes the rest. Author: David Yang shah

thanks

13 Aug 2009 keep KEEP is complementary to the "clear" command: it keeps the supplied variables and deletes the rest. Author: David Yang Florian

25 Jun 2009 keep KEEP is complementary to the "clear" command: it keeps the supplied variables and deletes the rest. Author: David Yang Deneux, Thomas

looks great, but the code can be much more simple!
for example,

function keep(varargin)

% variables to clear in a cell array
varlist = evalin('caller','who');
varlist = setdiff(varlist,varargin);

% make a string (separate the variable by a space)
[varlist{:,2}] = deal(' ');
varlist = varlist';
varstr = [varlist{:}];

% and clear!
evalin('caller',['clear ' varstr])

08 Oct 2008 keep KEEP is complementary to the "clear" command: it keeps the supplied variables and deletes the rest. Author: David Yang Falkenstern, Kristyn

Thank you! this is great.

23 Sep 2008 keep KEEP is complementary to the "clear" command: it keeps the supplied variables and deletes the rest. Author: David Yang Pouko, Touko

Bravissimo!

Top Tags Applied by David
clear variables, keep complementary, tools, utilities
Files Tagged by David
Updated   File Tags Downloads
(last 30 days)
Comments Rating
10 Aug 1999 keep KEEP is complementary to the "clear" command: it keeps the supplied variables and deletes the rest. Author: David Yang clear variables, keep complementary, tools, utilities 125 36
  • 4.94737
4.9 | 38 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