指定 Mathematica 中的保存目录
考虑:
ALLdwafDif[#] & /@ symmetries
Save["ALLL.m", ALLL]
有没有办法将结果保存在特定目录中?现在它会自动将结果保存在我的用户目录中。
Considering :
ALLdwafDif[#] & /@ symmetries
Save["ALLL.m", ALLL]
Is there a way to save the results in a particular directory ? It automatically save the results in my user directory now.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
当前工作目录由
Directory[]
给出。您可以通过SetDirectory[]
进行设置。或者,您可以将目录名称附加到ALLL.m
并且它可以工作。例如,
执行您所期望的操作(
~
是大多数 Unices 上主目录的快捷方式,mma 尊重它,因此它会保存在我的桌面上)The current working directory is given by
Directory[]
. You can set it bySetDirectory[]
. Alternatively, you can append the directory name toALLL.m
and it works.eg
does what you'd expect (
~
is a shortcut for home directory on most Unices, and mma respects it, so this gets saved on my desktop)如果您想永久更改默认工作目录,可以将
SetDirectory["new_dir"];
之类的内容添加到$BaseDirectory/Kernel/init.m
文件之一,或者$UserBaseDirectory/Kernel/init.m
(哪一个取决于您是要更改所有用户的默认目录还是仅更改当前用户的默认目录)。下次重新启动 Mathematica 时,Directory[]
将自动设置为new_dir
。If you want to change the default working directory permanently you can add something like
SetDirectory["new_dir"];
to one of the files$BaseDirectory/Kernel/init.m
or$UserBaseDirectory/Kernel/init.m
(which one depends on whether you want to change the default directory for all users or for the current user only). Next time you restart Mathematica,Directory[]
will then automatically be set tonew_dir
.弹出一个标准系统保存文件对话框,并在您选择位置后保存文件(如果您选择了一个位置,则保存新文件名)。
brings up a standard system save-file dialog box and saves your file after you've chosen a location (and a new file name if you have chosen one).
我发现将数据保存在与笔记本相同的位置很有用:
或者保存在(默认)Dropbox 目录中:
我很少使用由
SetDirectory[]
和朋友控制的目录堆栈。I find it useful to save data in the same location as the notebook:
Or to save in your (default) Dropbox directory:
I rarely use the directory stack that's controlled by
SetDirectory[]
and friends.