How to choose the default search path at startup?

2 visualizaciones (últimos 30 días)
Lubos Pastor
Lubos Pastor el 29 de Abr. de 2018
Comentada: Image Analyst el 30 de Abr. de 2018
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.

Respuestas (2)

Aref Majdara
Aref Majdara el 29 de Abr. de 2018
Hi Lubos,
In 'Home' tab, go to 'Preferences', then to 'General'.
  1 comentario
Lubos Pastor
Lubos Pastor el 30 de Abr. de 2018
Thank you but perhaps I was unclear. Your suggestion would help me set the initial working folder. But my problem is different---it is that MATLAB's search path always resets to include an undesirable directory, even after I manually delete that directory from the Set Path menu and save.

Iniciar sesión para comentar.


Image Analyst
Image Analyst el 30 de Abr. de 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 comentarios
Lubos Pastor
Lubos Pastor el 30 de Abr. de 2018
Thank you. I don't seem to have a startup file:
>> which startup
'startup' not found.
I have tried creating one and saving it in the MATLAB/R2017b/toolbox/local directory (where my pathdef.m is) but it said I don't have the permission to do so. But I am hesitant to ask my admin to mess with the startup file because on my other laptop I don't have a startup.m file either and yet I don't have the problem with the startup path. The problem appears to be elsewhere, yet I don't know where...
Image Analyst
Image Analyst el 30 de Abr. de 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.

Iniciar sesión para comentar.

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by