How to set a folder as Current folder for every startup of Matlab?
99 ビュー (過去 30 日間)
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
Wayne King 2014 年 3 月 28 日
編集済み: Wayne King 2014 年 3 月 28 日
On MAC OS try changing the file of userpath(), which I think defaults to your Documents directory, you can confirm this by entering
at the command line.
should persist across MATLAB sessions.
Or read this:
その他の回答 (7 件)
Amar Neçaibia 2018 年 2 月 19 日
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.
Bora Eryilmaz 2015 年 11 月 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 日
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
sajjad hosseinifard 2018 年 2 月 15 日
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!
Yuliano Moscoso Yarin 2019 年 4 月 10 日
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 日
If you want a program to start in the directory /home/abc/def, just write in the first line of the source code:
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):