Mathematica 9 is now available
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 smc.vnet.net
  • Subject: [mg86666] Re: Clearing selected variables
  • From: Roland Franzius <roland.franzius at uos.de>
  • Date: Mon, 17 Mar 2008 00:22:09 -0500 (EST)
  • References: <frg0ef$f0b$1@smc.vnet.net>

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

Begin["temp`"]


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

End[]

ClearAll/@ Names["temp`*"]

or a common string

lcx1=55
ytmp[t]:=t^2
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