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 pos
I finally found it.
You edit a file named startup.m
in /matlabrootfolder/toolbox/local
and I add cd /Users/ALJI/MATLAB
.
It worked, hope this help :)
Easier: You can see the default path by typing
userpath
If you create a variable named for example NewPath and assign the path you want to set as default:
NewPath = 'Users/You/Desktop/Projects';
you can then call :
userpath(NewPath);
restart matlab and the trick is done.
Defining actions that will be done each time you start matlab can be done in a very fast and easy way.
When you start matlap type:
edit startup
If it does not exist, create it. The commands in this file will be ran on every startup of matlab.
In your case you may also want to check help cd
for instructions on changing the directory programmatically.
In addition to startup
as answered by @Dennis, there's also the matlabrc file. That's what you should use if you need the setup to apply to all users:
On multiuser or networked systems, system administrators can put messages, definitions, or other code that applies to all users in their matlabrc.m file.
The file matlabrc.m invokes the startup.m file, if it exists on the search path MATLAB uses.
Individual users should use the startup.m file to customize MATLAB startup. The matlabrc.m file, located in the matlabroot/toolbox/local folder, is reserved for system administrators