startup.m应该在哪里? [英] Where is startup.m supposed to be?

查看:399
本文介绍了startup.m应该在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很长时间以来,我一直在MATLAB文档中追寻这个问题的答案...

I've been chasing the answer to this question in the MATLAB documentation for a long time...

例如,在

http://www.mathworks.com/help/matlab/matlab_env /changing-the-startup-folder.html

它说

使用startup.m文件指定启动文件夹...

Use the startup.m file to specify the startup folder...

...这是很荒谬的,因为文档中的其他地方说startup.m在所谓的启动文件夹"中可以找到.因此,该文件无法指定该文件夹的位置.

...which is plainly absurd, since elsewhere the documentation says that startup.m is to be found in the so-called "startup folder". So therefore there's no way for this file to specify where this folder should be.

等等,等等.这种圆度遍及我在startup.m上的文档中找到的所有内容.

Etc., etc., etc. This sort of circularity pervades everything I've found in the docs on startup.m.

我想知道的是:我可以还是不能以一种持久的方式自定义启动文件夹"的位置,如果可以,那么该持久信息将存储在哪里?

What I want to know is: can I or can't I customize the location of the "startup folder" in a way that is persistent, and if so, where is this persistent information stored?

推荐答案

我发现最好的方法就是这个.假设您希望MATLAB在mystartupdir中启动,并且已经将startup.m放置在该目录中.

The best method, I find, is this. Let's say you want MATLAB to start up in mystartupdir, and you've placed startup.m in that directory.

在Windows上,为MATLAB创建一个快捷方式图标,然后右键单击它并选择Properties.编辑字段Start In.现在,只要您想启动MATLAB,就使用此图标.

On Windows, make a shortcut icon to MATLAB, then right-click on it and select Properties. Edit the field Start In. Now, use this icon whenever you want to start MATLAB.

在其他平台上,可以使用-sd标志运行MATLAB以指定启动目录:

On other platforms, you can run MATLAB with the -sd flag to specify the startup directory:

matlab -sd mystartupdir

如果不指定启动目录,则MATLAB将使用userpath命令指定的默认目录.您可以在其中放置startup.m文件.

If you don't specify a startup directory, MATLAB will use the default specified by the userpath command. You can place your startup.m file there.

这篇关于startup.m应该在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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