Changeset 2270


Ignore:
Timestamp:
09/22/09 10:38:57 (15 years ago)
Author:
Mathieu Morlighem
Message:

simplified clearall

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/utils/OS/clearall.m

    r2245 r2270  
    11%script that erases all variables except ISSM_DIR
    2 list=whos;
    3 for i=1:length(list),
    4         if ~strcmpi(list(i).name,'ISSM_DIR'),
    5                 clear(list(i).name);
    6         end
    7 end
    8 clear list;
    9 clear i;
    102
     3%get all localvariables
     4Lvariables=evalin('base','who');
     5
     6%remove ISSM_DIR from this list
     7Lvariables=Lvariables(find(~strcmp(Lvariables,'ISSM_DIR')));
     8
     9%clear all
     10clear(Lvariables{:},'Lvariables')
Note: See TracChangeset for help on using the changeset viewer.