Setting initial working folder in linux

12 Ansichten (letzte 30 Tage)
Hi there,
I have been trying to setup MATLAB on a linux system and this is my first time working with linux and MATLAB. I have secondary drive that is set to automount at boot and would like to relocate my working directory to that location. I did everthing that MATLAB recommends from setting it up as the initial working directory under general setting and adding it to the MATLAB search path, but to no avail.
Is there a workaround to this issue?

Akzeptierte Antwort

Dinesh
Dinesh am 3 Jul. 2024
Hello Yashas.
As of version R2024a, the default setting is in such a way that your previous working directory will be opened.
If using the "Initial working folder" option to specify the folder path in "General" section of the "Preferences" dialog doesn't help you open a specific directory every time you open MATLAB, then here's a potential workaround:
You can make use of the "startup.m" file in MATLAB that executes every time MATLAB is opened. You can edit this file to add a new command to change the working directory on startup.
cd('<absolute_path_to_your_working_directory>');
Here's the documentation link that will help you to edit the "startup.m" file: https://www.mathworks.com/help/matlab/ref/startup.html

Weitere Antworten (0)

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange

Produkte


Version

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by