How to change default path on startup for Mac?

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.

답변 (3개)

Geoff Hayes
Geoff Hayes 2014년 6월 17일

0 개 추천

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
Cary 2014년 6월 17일

0 개 추천

I tried this, I had to create a startup.m file because I had none to begin with. But the directory on startup hasn't changed.

댓글 수: 6

Geoff Hayes
Geoff Hayes 2014년 6월 17일
편집: Geoff Hayes 2014년 6월 17일
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
Cary 2014년 6월 17일
/Users/Cary/Documents/MATLAB
Cary
Cary 2014년 6월 17일
Thanks for your response, unfortunately I am getting MATLAB:load:couldNotReadFile error. I renamed the mentioned startup.m file and right below "load matlab.mat" I typed cd "/Users/Cary/Stats/".
Geoff Hayes
Geoff Hayes 2014년 6월 17일
편집: Geoff Hayes 2014년 6월 17일
Remove or comment out the load matlab.mat as it is there for show. I've attached my startup.m as an example.
Cary
Cary 2014년 6월 17일
Got it working finally, thanks very much for your help. Now I can focus!
Awesome!

댓글을 달려면 로그인하십시오.

Bill Whiten
Bill Whiten 2014년 6월 18일

0 개 추천

Allows you to select folder on startup (and other times) also reopens files in editor and restores path.

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

질문:

2014년 6월 17일

답변:

2014년 6월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by