How to add a path permanantly in matlab and save it?


Here is The Mathworks' documentation on setting the search path in MATLAB; note the section at the bottom titled "How MATLAB Stores the Search Path" about making changes permanent: http://www.mathworks.com/help/matlab/matlab_env/what-is-the-matlab-search-path.html

| improve this answer | |
  • 3
    link dumping is not the correct way ;) to gain rep it is adviced to copy the important parts over and link to the source. – Rinzwind Apr 21 '14 at 5:29
  • i see y'all are a full service shop over here (i don't intend to improve this answer; someone else is welcome to post something more polished) – Tim Smith Apr 21 '14 at 5:35
  • fine. a moderator probably will delete it then ;) – Rinzwind Apr 21 '14 at 5:43
  • @ Tim Smith: I added the path location in pathdef.m file located in "/usr/local/MATLAB/R2012a/toolbox/local". "/usr/local/MATLAB/R2012a" is my matlabroot location. I had to change the permissions of the 'local' folder before editing pathdef.m. It works! – geoman Apr 21 '14 at 13:02

Changes to your path will be continued if you add the path to your startup.m file. You can change it in Matlab by entering into the Matlab command window:

edit startup

Then add the path to file the same way you would in the command line


You can also use startup.m to permanently change figure defaults and most other settings.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.