|
|
Clear all except some?
Hi all,
how can I clear all the variables in my Workspace except some chosen ones?
Thanks,
Aino
|
|
0
|
|
|
|
Reply
|
Aino
|
8/13/2010 4:53:04 PM |
|
"Aino" <aino.tietavainen@removeThis.helsinki.fi> wrote in message <i43t9g$35k$1@fred.mathworks.com>...
> Hi all,
>
> how can I clear all the variables in my Workspace except some chosen ones?
>
> Thanks,
> Aino
clear variables you do not want
or find keep (et al) on the FEX. It's a very useful function to have.
|
|
0
|
|
|
|
Reply
|
Sean
|
8/13/2010 5:04:05 PM
|
|
On 8/13/10 12:53 PM, Aino wrote:
> Hi all,
>
> how can I clear all the variables in my Workspace except some chosen ones?
>
> Thanks,
> Aino
Use
clearvars -except ...
Here's an example:
>> a=1;b=2;c=3;d=4;e=5;f=6;
>> whos
Name Size Bytes Class Attributes
a 1x1 8 double
b 1x1 8 double
c 1x1 8 double
d 1x1 8 double
e 1x1 8 double
f 1x1 8 double
>> clearvars -except c f
>> whos
Name Size Bytes Class Attributes
c 1x1 8 double
f 1x1 8 double
Here's the reference page:
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/clearvars.html
Best wishes,
Tom
|
|
1
|
|
|
|
Reply
|
Tom
|
8/13/2010 6:23:02 PM
|
|
Thank you all!
-Aino
Tom Bryan <tom.bryan@mathworks.com> wrote in message <i442i6$sh4$1@fred.mathworks.com>...
> On 8/13/10 12:53 PM, Aino wrote:
> > Hi all,
> >
> > how can I clear all the variables in my Workspace except some chosen ones?
> >
> > Thanks,
> > Aino
>
> Use
>
> clearvars -except ...
>
> Here's an example:
>
> >> a=1;b=2;c=3;d=4;e=5;f=6;
> >> whos
> Name Size Bytes Class Attributes
>
> a 1x1 8 double
> b 1x1 8 double
> c 1x1 8 double
> d 1x1 8 double
> e 1x1 8 double
> f 1x1 8 double
>
> >> clearvars -except c f
> >> whos
> Name Size Bytes Class Attributes
>
> c 1x1 8 double
> f 1x1 8 double
>
> Here's the reference page:
> http://www.mathworks.com/access/helpdesk/help/techdoc/ref/clearvars.html
>
> Best wishes,
> Tom
|
|
0
|
|
|
|
Reply
|
Aino
|
8/14/2010 11:42:04 AM
|
|
|
3 Replies
2111 Views
(page loaded in 0.054 seconds)
Similiar Articles: Clear all except some? - comp.soft-sys.matlabHi all, how can I clear all the variables in my Workspace except some chosen ones? Thanks, Aino ... save all variables except some into .mat file - comp.soft-sys ...Clear all except some? - comp ... MATLAB's save and load commands let you ... from a MAT-file into a ... file - MATLAB Save all variables from the workspace in binary MAT ... Closing all figures except one - comp.soft-sys.matlab% now, close some... close(fh([2,4,5])); % and check again ... code - comp.soft-sys.matlab close all; % Close all figures (except those of imtool.) clear all ... How to purge all /VAR/STM logs? - comp.sys.hp.hpuxI am having problems clearing all the stm ... space as it does not remove some of the raw logs. Is there any methods to clear ("zap") all ... os directory can be removed EXCEPT ... dilation and erosion code - comp.soft-sys.matlab... the time for some reason, instead of to the max value like I said. Here is improved code: clc; % Clear the command window. close all; % Close all figures (except ... GLCM on an irregular region - comp.soft-sys.matlabclose all; % Close all figures (except those of imtool.) clear all; % Erase all existing variables. ... in it, then you'd have to set the masked out pixel values to some ... rgb to grayscale using jet colormap intensity - comp.soft-sys ...clc; % Clear the command window. close all; % Close all figures (except those of imtool.) imtool close all ... I'm still having some trouble though. My original ... Fill a single contour - comp.soft-sys.matlab... to join some lines if the newsreader splits them into two, which it will do for long lines.) clc; % Clear the command window. close all; % Close all figures (except ... Generate noise model[Please help] - comp.soft-sys.matlab ...IMPORTANT: THE NEWSREADER MAY SPLIT SOME LONG LINES INTO TWO, AND ... Clear the command window. close all; % Close all figures (except those of imtool.) clear; % Erase all ... Remove foreground. - comp.soft-sys.matlabI need some help figure out how to remove the ripples ... See this demo: clc; % Clear the command window. close all; % Close all figures (except those of imtool ... Clear all except some? - comp.soft-sys.matlab | Computer GroupHi all, how can I clear all the variables in my Workspace except some chosen ones? Thanks, Aino ... Clear all except some? - Newsreader - MATLAB CentralHi all, how can I clear all the variables in my Workspace except some chosen ones? Thanks, Aino 7/22/2012 1:55:58 AM
|
|
|
|
|
|
|
|
|