How to avoid setting of local directory as search path on startup?

2 次查看(过去 30 天)
Hello,
I used to use R2011 and before. I just installed R2013a. Now I have a little problem with my configuration: The directory I start matlab from gets added to the search path (recursively).
This is mad, since I have different projects in subfolders. I have to manually delete all dirs from search path before I can begin to work. This also results in BIG trouble if I start matlab from my home directory. Here a few thounds of dirs get added, whch take quite a bit of time to be first added and then manually (!) deleted.
How can I set up martlab to avoid adding the local dir to the search path?
I have two installations both with the same issue, so I think this is the default for now ?!?
Thank Christian Wolf

采纳的回答

Christian
Christian 2013-12-4
I've got it! The problem was that I added sdpt3 to my path. There is a startup.m file that caused the problems. After a small change in that file to disable the change of path not more issue.
Thanks Christian
  2 个评论
Image Analyst
Image Analyst 2013-12-4
Mind explaining (1) what exactly is sdpt3, since it's not in base MATLAB, (2) how it got into your startup.m file in the first place, and (3) how it recursively extends/adds to your path over and over again every time you launch MATLAB?
Christian
Christian 2013-12-4
OK, SDPT3 is a toolbox for optimization interacting with yalmit (another toolbox) (see YALMIP and SDPT3).
The installation of SDPT3 tells you to add the directory of it to the path. In this directory there is a startup.m file, that is intended to add sdpt3 to the path of matlab (the second time if already installed as documented). This adds the output of pwd to the path, thus resulting in the described behaviour.
So it was not my startup.m file (there was not even one) but a file from an external toolbox.

请先登录,再进行评论。

更多回答(2 个)

Image Analyst
Image Analyst 2013-12-4
Put
restoredefaultpath
savepath
in your startup.m file. But personally I'd try to figure out the root cause of the problem in the first place.

Simon
Simon 2013-12-4
Hi!
Use the matlab startup script matlabrc and restore the default path

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by