有没有办法在开始使用 Mathematica 之前清除所有内容? [英] Is there a way to clear everything before starting in Mathematica?

查看:67
本文介绍了有没有办法在开始使用 Mathematica 之前清除所有内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 MATLAB 中有函数 clear 可以删除所有当前变量.如果您开始一些全新的事情并且不想与之前的计算发生冲突,这将非常有用.我现在正在为 Mathematica 搜索类似的东西,但除了 Clear[VAR] 之外我找不到任何东西,它只删除了变量 VAR.

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.

推荐答案

我推荐以下两种方法之一:

I recommend one of two methods:

有一个系统文件 KeyEventTranslations.tr,您可以编辑它来自定义键盘快捷键.我和其他人一样,已将 Ctrl+Q 添加到 Quit[] 内核,允许快速清除所有会话变量.有关设置的更多信息,请参阅:

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:

在 Mathematica 中,当前的 $Context 定义了 Context 不合格的符号名称属于.通过为新 Notebook 提供唯一的上下文(可通过 Evaluation 菜单轻松完成),该 Notebook 中使用的符号不会与其他 Notebook 中的未限定符号发生冲突.有关更多详细信息,请参阅以下问题:

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 之前清除所有内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆