This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

Clear

Clear
clears values and definitions for the .
Clear
clears values and definitions for all symbols whose names match any of the string patterns .
  • Clear does not clear attributes, messages, or defaults associated with symbols.
  • Clear allows abbreviated string patterns containing the following metacharacters:
*zero or more characters
@one or more characters, excluding uppercase letters
\\*, etc.literal *, etc.
  • Clear clears all symbols in a particular context.
Clear a variable:
Clear a function definition:
Clear a variable:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
 
Clear a function definition:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
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:
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