How to choose the default search path at startup?
3 views (last 30 days)
Show older comments
I have a directory in my search path that is causing trouble. I would like to permanently delete it. When MATLAB is open, I go to Set Path, delete the directory, and save. But when I exit MATLAB and start it again, the directory comes back at the top of my search path. (It does not come back on a different computer I have.) Would you please advise how I can permanently remove the directory from my search path so that I don't have to manually delete it every time I start MATLAB? Thank you.
0 Comments
Answers (2)
Image Analyst
on 30 Apr 2018
Edit your startup.m file and look for things in there that are changing your search path. Delete anything you see that you don't like. If you want, you can put this into your startup.m file:
restoredefaultpath % Only if necessary
cd('C:/whatever/folder/you/want'); % Have it start in whatever folder you want it to.
2 Comments
Image Analyst
on 30 Apr 2018
My startup.m file is in d:\MATLAB. I set a path to that folder with the SetPath button. Be sure to save it once you specify it. I have all kinds of stuff in my startup.m file that I want to do. If all you want to do is set the starting "current folder" to be what you want, then use Aref's solution.
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!