In MATLAB there is the function clear to delete all current variables. This is very useful if you start something totally new and don’t want to get conflicts with earlier calculations. I’m searching something similar for Mathematica now, but I couldn’t find anything except of Clear[VAR] which removes only the variable VAR.
Share
I recommend one of two methods:
1. Keyboard shortcut to Quit[] the kernel
There is a system file
KeyEventTranslations.trthat you can edit to customize keyboard shortcuts. I, as others, have added Ctrl+Q toQuit[]the kernel, allowing for a rapid clearing of all sessions variables. For more information on setting this up, see:2. Give the new Notebook a unique context
In Mathematica, the current
$Contextdefines what Context unqualified symbol names belong to. By giving a new Notebook a unique Context, which is easily done through theEvaluationmenu, the symbols used in that Notebook will not collide with unqualified symbols in other Notebooks. See the following question for more detailed information: