How to change default path on startup for Mac?
Show older comments
I have the newest version. I have played around with 'userpath' but no matter what I do, every time I open MATLAB it defaults to the old directory. How can I change this? Many thanks.
Answers (3)
Geoff Hayes
on 17 Jun 2014
There is a startup.m file that you can update to change to another directory (I've done the same on my Mac) on start up. In the Command Window type
open startup.m
and the file will be opened in the editor (file located on my computer at /Applications/MATLAB_R2014a.app/toolbox/local). Just add a line similar to the following
cd /Users/geoff/Development/matlab
Save and restart MATLAB and see what happens.
Cary
on 17 Jun 2014
0 votes
6 Comments
Geoff Hayes
on 17 Jun 2014
Edited: Geoff Hayes
on 17 Jun 2014
Where have you saved this startup.m file to?
I should have pointed out that there is a file, startupsav.m, found in the /Applications/MATLAB_R2014a.app/toolbox/local directory, that should be renamed to startup.m.
Cary
on 17 Jun 2014
Cary
on 17 Jun 2014
Geoff Hayes
on 17 Jun 2014
Edited: Geoff Hayes
on 17 Jun 2014
Remove or comment out the load matlab.mat as it is there for show. I've attached my startup.m as an example.
Cary
on 17 Jun 2014
Geoff Hayes
on 18 Jun 2014
Awesome!
Bill Whiten
on 18 Jun 2014
0 votes
You could try: http://www.mathworks.com/matlabcentral/fileexchange/39425-restore-project-status-for-selected-project
Allows you to select folder on startup (and other times) also reopens files in editor and restores path.
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!