startup.m应该在哪里?

编程入门 行业动态 更新时间:2024-10-25 09:34:32
本文介绍了startup.m应该在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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

例如,在

www.mathworks/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应该在哪里?

本文发布于:2023-06-09 04:12:41,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/595001.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:startup

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!