Is there a way to clear everything before starting in Mathematica?

前端 未结 3 1957
面向向阳花
面向向阳花 2021-02-04 06:03

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 earl

3条回答
  •  难免孤独
    2021-02-04 06:40

    I recommend one of two methods:

    1. Keyboard shortcut to Quit[] the kernel

    There is a system file KeyEventTranslations.tr that you can edit to customize keyboard shortcuts. I, as others, have added Ctrl+Q to Quit[] the kernel, allowing for a rapid clearing of all sessions variables. For more information on setting this up, see:

    • Customizing Mathematica shortcuts

    2. Give the new Notebook a unique context

    In Mathematica, the current $Context defines what Context unqualified symbol names belong to. By giving a new Notebook a unique Context, which is easily done through the Evaluation menu, the symbols used in that Notebook will not collide with unqualified symbols in other Notebooks. See the following question for more detailed information:

    • Mathematica - Separating Notebooks

提交回复
热议问题