MATLAB Answers

Why am I unable to save my MATLAB path using MATLAB 7.9 (R2009b)?

17 views (last 30 days)
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.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 7 Jan 2010
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.

More Answers (0)

Products


Release

R2009b

Community Treasure Hunt

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

Start Hunting!