Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Matlab search path for all users on linux

How can I add a Matlab search path for all users on a Linux system?

I am managing a Linux computer that is shared by several people. I want to place some Matlab *.m files at a path (for example, /usr/local/matlab/our_matlab_scripts/) which everyone has a read access permission. I also want to add this path to the Matlab search paths of all users so that they can start using the Matlab files immediately.

As a single user, I learned that I can add a search path by Matlab 'addpath' command or from the file menu of Matlab, for example. However, so far I could not find a way to do it as an administrator for all the current and future users at once.

I would be grateful if you could kindly teach me.

like image 945
norio Avatar asked Oct 08 '22 23:10

norio


1 Answers

If you look at this thread:

http://www.mathworks.com/matlabcentral/newsreader/view_thread/112560

you will find that there is a file called matlabrc.m that is executed at startup. It looks for the startup.m file that users can have. One could put the addpath commands in this file and it should work for all users.

like image 179
vextorspace Avatar answered Oct 18 '22 11:10

vextorspace