Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

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


  • 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