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

2 vues (au cours des 30 derniers jours)
Christian
Christian le 4 Déc 2013
Commenté : Christian le 4 Déc 2013
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

Réponse acceptée

Christian
Christian le 4 Déc 2013
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 commentaires
Image Analyst
Image Analyst le 4 Déc 2013
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 le 4 Déc 2013
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.

Connectez-vous pour commenter.

Plus de réponses (2)

Image Analyst
Image Analyst le 4 Déc 2013
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 le 4 Déc 2013
Hi!
Use the matlab startup script matlabrc and restore the default path
  2 commentaires
Christian
Christian le 4 Déc 2013
You mean every time I start matlab?
Simon
Simon le 4 Déc 2013
No! Put the commands in startup.m, like Image Analyst showed above.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by