在Linux中更改MATLAB的启动文件夹 [英] Changing MATLAB's startup folder in Linux
问题描述
但是MATLAB仍然在我的主目录中启动,而不是在/path/to/my/startup
中.
But still MATLAB starts in my home directory, and not in /path/to/my/startup
.
还有什么我需要做的吗?我可以在matlab.prf
中手动编辑startup
文件夹吗?
Is there anything else I need to do? Can I edit the startup
folder manually in matlab.prf
?
谢谢
推荐答案
我不知道执行此操作的常规方法,但是简单的方法只是将用户路径设置为个人脚本目录.
I don't know the regular way to do this, but the easy way is just settings the userpath to your directory of personal scripts.
在该文件夹中,放入一个脚本startup.m
,该脚本包含:
In that folder, you put a script startup.m
which contains:
cd /path/to/my/startup
它可能看起来不太漂亮,但这使您可以根据其他因素来更改目录.我看到了一些示例,这些示例在启动时提示您您正在从事哪个项目?".根据个人输入,我会从不同位置加载设置,具体取决于MATLAB正在使用的计算机(家用计算机,我的大学中的个人计算机,大学中的计算机房等). )
It might not look pretty, but this allows you to change the directory depending on other factors. I have seen examples of people who get a prompt at startup that asks 'Which project are you working on?' and depending on their input some files are loaded, the direcotry is changed, etc. Personally, I load settings from different locations depending on what computer MATLAB is working on (home computer, personal computer at my university, computer rooms at university, ...)
也许只是一个小主意,可以帮助您解决这些变量:您始终可以尝试编辑Linux的MATLAB启动脚本(不是startup.m
,而是which matlab
).
edit: Perhaps just a small idea that might help you along with those variables: you can always try to edit the MATLAB start script for Linux (not startup.m
but the bash script returned by which matlab
in your shell).
这篇关于在Linux中更改MATLAB的启动文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!