Borrar filtros
Borrar filtros

Another pathdef.m question

7 visualizaciones (últimos 30 días)
Stan Kruger
Stan Kruger el 6 de Feb. de 2015
Comentada: Stan Kruger el 9 de Feb. de 2015
I've seen this question asked multiple times, and have still not found a satisfactory answer.
I am running matlab from unix, and I do not have write permissions in the folder where matlab is kept. I want matlab to read and apply my custom path definitions as written in pathdef.m - I want this done automatically on startup. If I start matlab from my own data allocation, within the folder where I keep pathdef.m, there is no problem, matlab reads pathdef.m and all my paths are defined as I want. However, if I start matlab from anywhere else, matlab doesn't read pathdef.m, and I have to manually set the path. This is undesireable, I want pathdef.m to be read and applied no matter where I start matlab from.
I assume this same problem will occur if I customize a startup.m file as well, which is also undesireable. Can anybody assist me? Thanks.

Respuestas (1)

Jan
Jan el 7 de Feb. de 2015
The pathdef.m included in Matlab's program path matlabroot is used, if there is no such file in the current directory, as you have observered. This is the wanted behavior, because the path should be defined properly as default.
In opposite to pathdef.m there is no startup.m file included in Matlab as default. Therefore the startup function is user-defined only. Therefore the startup function is the right location to include user-defined changes to the path.
  1 comentario
Stan Kruger
Stan Kruger el 9 de Feb. de 2015
Hi Jan, thanks for the answer. I do agree that it is important to have a well defined default path, however, it seems even more important to be able to control what that default path is. It sounds like you are saying that this is not an option in my case. Since I lack the permissions to change this default pathdef.m the only real option is to make sure I always start matlab from the directory where I have created my own pathdef.m.
Is this accurate? Thanks very much.

Iniciar sesión para comentar.

Categorías

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

Community Treasure Hunt

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

Start Hunting!

Translated by