Clearing symbol values, removing symbols from memory and general garbage collection.
26
votes
2answers
655 views
Is there a way to separate variables between multiple notebooks?
I often correct homework by checking the calculations in Mathematica. Sometimes you would like to have two solutions open at once. However often defined symbols such as ...
15
votes
5answers
3k views
How do I clear all user defined symbols?
Is there some way to do this other than going to Evaluation -> Quit kernel and firing a new one up?
12
votes
4answers
937 views
Clear complains that a variable is not a symbol or a string?
Here's a small listing where I've used EscqEsc to typeset θ in the notebook:
...
7
votes
3answers
376 views
Elegant manipulation of the variables list
I have a list of global variables (some of them are indexed variables), for example:
varsH = Hold[U0[1], U0[2], B0, V0[1], V0[2]]
Or (if it is easier to handle) ...
10
votes
2answers
360 views
How to unload automatically loaded packages?
I know that this has been discussed here (How do I clear all user defined symbols?), but my case is somewhat different. How does one unload packages during runtime that were loaded with the start of ...
12
votes
3answers
297 views
How to clear parts of a memoized function?
I have a function of two variables, e.g.:
f[a_, b_] := f[a, b] = something f[a - 1, b - 1] etc
With the above code I used the concept of memoization to speed up ...
12
votes
6answers
333 views
How to clear all variables except one?
I have a lot of variables: $a,b,c,d, \ldots $
I want to clear the values of all of them except $b$. It's really lengthy to write
Clear[a];
Clear[c];
...
Is ...