在启动时设置默认的Matlab路径 [英] setting a default matlab path at startup

查看:62
本文介绍了在启动时设置默认的Matlab路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的团队正在尝试标准化我们的Matlab路径,以使每个人都拥有相同的路径.

My team is trying to standardise our Matlab paths so that everyone has the same.

我有一个我们都应该拥有的默认Matlab路径列表.

I have a list of the default matlab path that we should all have.

因此,我们希望有一个脚本在打开matlab时运行,以确保将我们的路径设置为默认的matlab路径.因此,如果已将路径添加到我们的默认列表中,则会将其添加到正确的位置.

So we would like to have a script that runs when matlab opens to make sure that our paths are set to the default matlab path. So if a path has been added to our default list it will be added in the correct place.

在Matlab中有可能吗?

Is this possible in Matlab?

我读到有关启动的信息,但这似乎与设置工作目录有关,该目录与我尝试执行的工作目录不同.

I read about startup but that seems to do with set your working directory which is different to what I am trying to do.

推荐答案

您可以使用

You can change which directory MATLAB starts in using the userpath function so that whenever you start up MATLAB, the path will automatically redirect here.

如果MATLAB本身在网络上运行,并且多个实例可以在同一网络目录中启动,则这可能很有用.

This may be useful if you have MATLAB running on a network per se, and multiple instances can start in the same network directory.

在此处从MathWorks中了解更多信息: http://www.mathworks.com/help/matlab/matlab_env/matlab-startup-folder.html

See more from MathWorks here: http://www.mathworks.com/help/matlab/matlab_env/matlab-startup-folder.html

但是,如果要使所有内容标准化,以便每个人都可以访问同一路径,则可以使用 startup 将目录/文件夹添加到MATLAB的路径,但是如果要完成该软件包,使用 userpath 来使MATLAB从指定目录开始.

However, if you want to standardize everything so that everyone has access to the same path, you can use startup to add directories / folders to MATLAB's path, but if you want to complete the package, use userpath to get MATLAB to start at a specified directory.

您的 startup.m 文件可能看起来像这样:

Your startup.m file may look something like this:

addpath('/folder/to/add/one');
addpath('/folder/to/add/two');
addpath('/folder/to/add/three');
addpath('/folder/to/add/four');

然后为您的 userpath 设置功能以完成所有操作:

Then set your userpath with the function to complete everything:

userpath('/folder/to/start');
addpath('/folder/to/start');

还要确保也将此新​​文件夹也添加到 startup.m 文件中.

Also make sure you add this new folder to your startup.m file too.

这篇关于在启动时设置默认的Matlab路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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