13

I am a new user. According to a documentation, Clear["context`*"] clears all symbols in a particular context.

I want to clear everything (functions, variables, etc..) After I use the above command, my function n1[x,y] is still defined.

Thanks

Mikhail Genkin
  • 607
  • 1
  • 4
  • 11
  • 3
    try CleanSlate package I do not know if it still works on V 10 or not. CleanSlate, tries to do everything possible to return the kernel to the state it was in when the CleanSlate.m package was initially loaded (I myself, when I want to make sure everything is clear, just restart the kernel) – Nasser Aug 03 '15 at 19:35
  • 1
    They may be looking for Remove – Andy Ross Aug 03 '15 at 19:45
  • Beware: Dynamic content, including Manipulate and DynamicModule, in open notebooks can work against simply clearing or quitting the kernel. – Michael E2 Aug 03 '15 at 19:45
  • 2
    Did you literally execute Clear["context`*"] or did you try Clear["Global`*"]? Or perhaps another context? – Michael E2 Aug 03 '15 at 19:47
  • You have to delete all outputs containing Dynamic or Initialization for DynamicModules since those are going to be evaluated after you quit kernel. – Kuba Aug 03 '15 at 20:08
  • Another caution: if you sign in to Wolfram Cloud, then you may have objects in the context CloudObject. – murray Aug 03 '15 at 20:10
  • Sometimes, the most efficient way is just to exit Mathmematica completely and start it again. – atapaka Aug 03 '15 at 22:09

2 Answers2

22

This will, as it says, remove all symbols and definitions made in the global context:

Remove["Global`*"]
hmilton
  • 376
  • 1
  • 6
13

As Nasser points out, the command Quit[] will quit the kernel completely. It will kill the kernel process, stopping the kernel from using any memory or remembering anything at all. Evaluating any command will re-start the kernel from scratch.

Patrick Stevens
  • 6,107
  • 1
  • 16
  • 42