Matlab 2024a creates "Downloads" folder automatically when start up

I installed matlab 2024a in CentOS Stream 9. It creates a folder named "Downloads" at my home directory everytime when I launch it. I really don't like this feature. In the previous version, it can be solved by 'userpath /path/prefer'. But it didn't work for 2024a. Is there a way to avoid creating "Downloads"?

3 Commenti

Hi Hua,
Locate your Matlab startup file, typically named startup.m. Edit the startup.m file and add the following line to set a custom download folder path:
userpath('/path/to/preferred/folder');
Replace /path/to/preferred/folder with the absolute path of the directory where you want downloads to be stored.
By following these steps, you can avoid Matlab 2024a from creating the "Downloads" folder in your home directory every time you launch the application.
For more information regarding startup.m, please refer to https://www.mathworks.com/help/matlab/matlab_env/matlab-startup-folder.html#
Hope this answers your question.
Thank you Umar. Your solution worked for the earlier versions, but it didn't work for R2024a. There was no startup.m with original installation. Then I created and put it either at ~/.matlab/R2024a or at MATLAB/R2024a/toolbox/local. None of these tests works. I guess there must be some changes since R2024a.
I found that it won't make the folder with command 'matlab -nojvm' or 'matlab -nodisplay'. That is to say, it was created only when launching the interface.

Accedi per commentare.

 Risposta accettata

Hua Wang
Hua Wang il 19 Lug 2024
Modificato: Hua Wang il 19 Lug 2024
Finally I found a solution, which might not be the best. When starting up with GUI, it creats 'Downloads' folder according to the setup of download folder in the Linux system. The default folder is $HOME/Downloads. The solution is to create a file .config/user-dirs.dirs. Just type the following line in the file.
XDG_DOWNLOAD_DIR="/path/prefer"

2 Commenti

Hi Hua,
I just noticed that you have edited your question in the posting and found the solution to your problem. If it works, please share your thoughts with us. If not, we are still here to help you out.
Yes the above solution to set up user-dirs.dirs works. Thank you Umar.

Accedi per commentare.

Più risposte (0)

Categorie

Richiesto:

il 19 Lug 2024

Commentato:

il 21 Lug 2024

Community Treasure Hunt

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

Start Hunting!

Translated by