Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2008

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

Search the Archive

Re: Clearing selected variables

  • To: mathgroup at
  • Subject: [mg86666] Re: Clearing selected variables
  • From: Roland Franzius <roland.franzius at>
  • Date: Mon, 17 Mar 2008 00:22:09 -0500 (EST)
  • References: <frg0ef$f0b$>

pradeep schrieb:
> Hello All,
> is there a way i can selectively clear all but a few variables in
> mathematica?? i have a large number of variables and am iteratively
> running my entire notebook through a loop and want most variables except
> a few to get cleared between iterations..
> any help would be appreciated!

The easiest way:
Give them a common Context


temp`x1 = 55
temp`y[t_]:= t^2/2


ClearAll/@ Names["temp`*"]

or a common string

ClearAll/@ Names["*tmp"]


Roland Franzius

  • Prev by Date: Re: Pi is not a real number?
  • Next by Date: Re: Exporting Graphs
  • Previous by thread: Re: Clearing selected variables
  • Next by thread: The size of a 3D plot