How to set a folder as Current folder for every startup of Matlab?
이전 댓글 표시
I would like to set the folder /Users/ALJI/MATLAB as a default current folder for Matlab. I mean on every start up Matlab should point to this folder. is it possible ? is there a way on Mac OS X ?
I am using Matlab r2009b on Mac OS X Snow Leopard.
thank you in advance
채택된 답변
추가 답변 (7개)
Amar Neçaibia
2018년 2월 19일
13 개 추천
To fix this problem, right click your Matlab icon, select Properties->shortcut, in "start in", delete the default folder and put the directory that you want its work.
댓글 수: 8
sajjad hosseinifard
2018년 2월 19일
thank u guy
Samuel Roberts
2018년 10월 4일
yes thanks guy
Jonas Gilbricht
2018년 12월 23일
thanks
Ahmad Faraz
2019년 4월 29일
Quick and easy. Thanks :)
RANJAN HALDER
2020년 9월 7일
THANKS,SIR,none of the above ways worked for me .This one really resolved the problem.
Veselin
2023년 6월 1일
Nothing else works, but this. Thanks
Yalc Copper
2023년 7월 15일
thx, that really works for me.
Bora Eryilmaz
2015년 11월 12일
12 개 추천
Starting in R2014b there is a MATLAB preference for doing this. Open the Preferences dialog from the Home tab in MATLAB and select MATLAB/General preferences tree node on the left side of the dialog. The General preference panel has an option to select the "Initial working folder".
joshua alviando
2020년 3월 9일
3 개 추천
first, open the file location of your matlab.exe

after that, create shortcut to whatever location (example : desktop)

then right click the shortcut icon and double click properties
in Shortcut bar, you can find start in text input, just paste your desire location

finally, you can pin the shortcut to taskbar for easy access
cheers ^^
댓글 수: 5
Yuliano Moscoso Yarin
2020년 3월 18일
Thanks finally is working on 2019b version
joshua alviando
2020년 3월 19일
you are welcome!
Matthew Wiser
2020년 4월 12일
Didn't work for me on Windows 10
Mahnoor Saeed
2021년 3월 31일
Work for me Windows 10.
Thankyou so much for detailed guidline :)
Michaela Konstantinou
2023년 7월 21일
is there any way to do this programmatically?
Andrej Trost
2019년 8월 30일
1 개 추천
"To fix this problem, right click your Matlab icon, select Properties->shortcut, in "start in", delete the default folder and put the directory that you want its work."
댓글 수: 1
Matthew Wiser
2020년 4월 12일
still doesn't work for me on Win10
sajjad hosseinifard
2018년 2월 15일
0 개 추천
I'm using Matlab 2017b on windows 10. its startup folder is C:\Program Files\MATLAB\R2017b\bin. I want to change it but I have not succeeded yet!!! I tried it with using preference settings and userpath() command but this folder is not changed!!! Please someone help me!
댓글 수: 3
Steven Lord
2018년 2월 15일
Modifying the "Initial working folder" preference in the General category of the preferences for MATLAB and applying that change didn't cause MATLAB to start in that directory the next time you restarted?
Christian Hurtig
2018년 4월 3일
I have a similar problem, though I end up in the system32 folder when running matlab from the start menu. The "initial working folder" doesn't seem to change the current working directory on start up. The shortcut option suggested by Amar works.
Marco Cadei
2018년 4월 15일
I think that there might be a bug because even on my PC modifying the "Initial working folder" preference in the General category of the preferences for MATLAB and applying that change didn't cause MATLAB to start in that directory. I did what Amar suggested and it work instead. I am using MATLAB R2018a on Windows 10
Yuliano Moscoso Yarin
2019년 4월 10일
0 개 추천
I have the same issues even trying differents methos like "Initial working folder" preference in the General or the start in option on propertie with outh any luck...
geofo
2022년 2월 8일
0 개 추천
If you want a program to start in the directory /home/abc/def, just write in the first line of the source code:
cd /home/abc/def
The syntax works under Windows, Mac and Ubuntu but of course the directories are usually different, so you cannot have one code that just works on all platforms.
For example you can write in Windows a start path in the source code (you can write with forward or backwards slash, it works):
cd c:/mycode/maindir
카테고리
도움말 센터 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!