필터 지우기
필터 지우기

set paths disappear after restart

조회 수: 39 (최근 30일)
Rafael Kübler
Rafael Kübler 2016년 12월 1일
댓글: Brian Cluggish 2018년 9월 14일
Hello together,
latley it occures to me, that I loose paths that I have set in matlab. I use File -> set Path... -> add Folder... choose the relevant folder and save it. The new added path works until i restart Matlab. Then the new path is disappeared from the list. And it seems, that all the previous added paths are deleted aswell.
Can't tell where the problem is, because thats the way i always did it.
Does anyone know how it is possible, how the path list is deleted? Is there a file, where it is stored?
Thank you for your effort.
Rafael
  댓글 수: 1
Rafael Kübler
Rafael Kübler 2016년 12월 1일
I have noticed, that when i set the path to default, all from me added path disappear, but when i restart matlab they are back again. So all my changes are temporarly and not permantent altough i save it. It seems to me, that matlab reads a different "path-file" when restarted.
How can i fix this?

댓글을 달려면 로그인하십시오.

채택된 답변

Jan
Jan 2016년 12월 1일
The path is stored in the file pathdef.m inside Matlab's program directory. If you do not work with admin privileges (as recommended), you do not have write permissions for this file and all changes of the path are temporarily only. This is useful on a multi-user system, because the pathdef.m file belongs to all users.
I've added one folder to the path in pathdef.m file, which contains a function, which adds the user-defined paths temporarily depending on the user and current project. This works reliably and flexible. Alternatively you can create a startup.m and finish.m file to store the current path persistently between sessions using setpref and getpref.
  댓글 수: 6
Symon Chester
Symon Chester 2018년 6월 5일
In 2018 this has to be nonsense. If I set the path and save it it should be restored everytime I start MatLab.
Brian Cluggish
Brian Cluggish 2018년 9월 14일
Agreed. I save pathdef.m to my startup folder. And when I use the command "which pathdef" after startup, it points to that folder. But MATLAB does not use it to set the path. I fixed this by adding the command "path(pathdef)" to my startup folder, so the path is set to what I save it to the last session. But MATLAB should be doing this automatically.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by