Be the first to rate this file! 11 downloads (last 30 days) File Size: 1.44 KB File ID: #24319

nclear

by Qun HAN

 

01 Jun 2009

Code covered by BSD License  

Clear all the other variables from the callers workspace except the specified ones.

Download Now | Watch this File

File Information
Description

Clear all the other variables from the callers workspace except the specified ones.

Useful when you have a lot of variables in the workspace and only want to keep a few of them and clear all the others.

%NCLEAR Clear all the other variables from the caller's workspace except the specified ones.
% NCLEAR(VAR1,VAR2,....) clears all the other variables except VAR1,VAR2,...
% NCLEAR('VAR1','VAR2',...) clears all the other variables except VAR1,VAR2,...
% NCLEAR() clears all the variables, save as CLEAR

MATLAB release MATLAB 7.8 (R2009a)
Zip File Content  
Other Files license.txt,
nclear.m
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
01 Jun 2009 someone

Yet another variation of clearex, keep2, keep3, etc already posted on the MATLAB FEX.

note: r2008a (finally) introduces CLEARVARS with these options
 
clearvars -except v1 v2 ...
clearvars -except -regexp p1 p2 ...
clearvars v1 v2 ... -except -regexp p1 p2 ...
clearvars -regexp p1 p2 ... -except v1 v2 ...

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
matlab Qun HAN 01 Jun 2009 10:51:10
 

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