MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Delete all the memory except 1 matrix


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.
> 
> 


  • Prev by Date: Re: Re: Compatibility woes
  • Next by Date: Re: Graphics3D of the official "arbitrary surface"
  • Previous by thread: Re: Delete all the memory except 1 matrix
  • Next by thread: Permutations of a sequence - variation 2