Clear Filters
Clear Filters

Setting initial working folder in linux

15 views (last 30 days)
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?

Accepted Answer

Dinesh
Dinesh on 3 Jul 2024 at 4:35
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

More Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Products


Release

R2024a

Community Treasure Hunt

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

Start Hunting!