Re: Delete all the memory except 1 matrix
- To: mathgroup at smc.vnet.net
- Subject: [mg76210] Re: Delete all the memory except 1 matrix
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Thu, 17 May 2007 06:59:10 -0400 (EDT)
- Organization: Uni Leipzig
- References: <f2haej$1kk$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
Hi, what is with SetAttributes[ClearExcept, HoldAll] ClearExcept[context_String, keepvarList_] := Module[{Saved`saved}, Saved`saved = keepvarList; Print[Saved`saved]; Clear[context]; MapThread[Set, {keepvarList, Saved`saved}] ] and a = 1; b = 3; c = 5; e = 7; ClearExcept["Global`*", {a, c}] will remove all symbols except a and c Regards Jens acmilan wrote: > Dear all, > Please help me on this basic problem. > If I want to clear all the calculations in history I usually use > Clear["Global`*"]; > But what should I use if I want to delete all except one or two > variable (for example a matrix K and M)? > Thank you very much for your help. > Best regards, > acmilan. > >