
How to choose the default search path at startup?
4 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(2 个)
Image Analyst
2018-4-30
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 个评论
Image Analyst
2018-4-30
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!