Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Core Language > Defining Variables and Functions > Assignments >

ClearAll

ClearAll[symb1, symb2, ...]
clears all values, definitions, attributes, messages and defaults associated with symbols.
ClearAll["form1", "form2", ...]
clears all symbols whose names textually match any of the formi.
Define values and attributes for a symbol:
Clear values and attributes:
Define values and attributes for a symbol:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
Clear values and attributes:
In[3]:=
Click for copyable input
In[4]:=
Click for copyable input
Out[4]=
Clear values of variables:
Clear functions (downvalues):
Clear upvalues:
Clear several symbols:
Clear all symbols in a given context:
Specify symbols to clear as string patterns:
Clear any old definitions before making new ones:
Unprotect and clear all symbols in a package, to allow it to be read twice:
Clear does not remove defaults, options or attributes:
Use ClearAll to clear everything:
Use =. to clear definitions with a particular left-hand side:
Clear all definitions:
Protected symbols cannot be cleared:
Use Unprotect to clear definitions of protected symbols:
Clear the definitions of all symbols in the current context:
New in 1
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team