MathGroup Archive 2007

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

Search the Archive

Re: Delete all the memory except 1 matrix

  • To: mathgroup at
  • Subject: [mg76210] Re: Delete all the memory except 1 matrix
  • From: Jens-Peer Kuska <kuska at>
  • Date: Thu, 17 May 2007 06:59:10 -0400 (EDT)
  • Organization: Uni Leipzig
  • References: <f2haej$1kk$>
  • Reply-to: kuska at


what is with

SetAttributes[ClearExcept, HoldAll]
ClearExcept[context_String, keepvarList_] :=
   Saved`saved = keepvarList;
   MapThread[Set, {keepvarList, Saved`saved}]


a = 1; b = 3; c = 5; e = 7;

ClearExcept["Global`*", {a, c}]

will remove all symbols except a and c


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