How to change the default path by using command?

19 vues (au cours des 30 derniers jours)
tqy
tqy le 21 Août 2012
Dear all,
I want change the default path to my project-document when MATLAB is starting, so that I need not to change it manually every time when I use the software.
Anyone know that how to do it? Can I finish it by the command?
Thanks a lot~~~

Réponse acceptée

Walter Roberson
Walter Roberson le 21 Août 2012
Use pathtool() and ask it to save the path.
  1 commentaire
Jan
Jan le 21 Août 2012
Or manually:
addpath(YourFolder);
savepath;

Connectez-vous pour commenter.

Plus de réponses (1)

Image Analyst
Image Analyst le 21 Août 2012
You can edit your startup.m file and put a cd command in there to change the starting "Current folder" - that's what I do. I change it from time to time as I concentrate on different projects.
  2 commentaires
tqy
tqy le 21 Août 2012
I'm sorry, but I can't find the startup.m?
do you mean pathdef.m?
Image Analyst
Image Analyst le 21 Août 2012
No. Type startup into the help and see what it says. Basically, see what folder MATLAB puts you in when you first start it. Then create a file called startup.m in that folder, and then place your call to cd() in there.
cd('C:\wherever');

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