MATLAB: Am I unable to save the MATLAB path using MATLAB 7.9 (R2009b)

addpathMATLABrmpath

I am not an administrator on this machine. Therefore, I am unable to save the path in 'pathdef.m' in its default location (as I do not have write privileges in the installation folders).
Thus, I have saved pathdef.m in another folder which is on my path. Now, I add more directories to the MATLAB path and save it. I can see that pathdef.m is updated and it contains the new paths. However, when I quit MATLAB and restart it, MATLAB restores to the default MATLAB path and it does not recognize the folders that I recently added. I have to add these folders to the path again.

Best Answer

This occurs because MATLAB is using your old pathdef.m file to load the path at startup.
To resolve this issue, place the new pathdef.m in your startup folder. You can set your startup folder using USERPATH. You can read more about this in the documentation for SAVEPATH:
doc savepath
Alternatively, use the ADDPATH command in a startup.m file (located in the startup directory or on your MATLAB path) to add the directories to your path. MATLAB will always execute the startup.m file at startup.