Why are users without administrative privileges not able to save their custom paths?
13 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 27 Jan. 2012
Kommentiert: Guojin Feng
am 26 Nov. 2018
We have computers running Windows XP which have multiple users. I am the only
account which has admin privileges. The other accounts are user
accounts. I can add directories to the path and save them with File->Set
Path, but the users cannot. They can add directories to the path, but not
save the path permanently as I can. I would like to know if there is a way these users can save their custom paths.
Akzeptierte Antwort
MathWorks Support Team
am 14 Apr. 2015
The MATLAB path is saved in the 'pathdef.m' file. This is located in the $MATLAB\toolbox\local directory ( where $MATLAB is the MATLAB root directory on your machine, as returned by typing
matlabroot
at the MATLAB command prompt.)
Other users who do not have administrative privileges are not able to write in this directory. This is the reason they are unable to save their paths.
To work around this issue, the users can save their ADDPATH command in "startup.m" in the current startup directory, if they have write permission to that directory.
The startup directory can be modified by right-clicking on the MATLAB shortcup and clicking on "properties".
Or, the users can save their ADDPATH command in a .m file in their respective work directories and run it using startup options each time they start MATLAB.
This can be done as follows:
1. The user must save their ADDPATH command in a file, say (username)_path.m.
2. While starting MATLAB, the user can start it up at the system prompt as follows:
matlab /r (username)_path
Alternatively, if the user starts up MATLAB by double clicking a shortcut, the shortcut may be edited as follows:
1. Right click on the MATLAB shortcut and select properties.
2. In the properties window, select the ‘shortcut’ tab.
3. In the ‘Target’, include the following option
/r (username)_path
For more information on startup options visit the appropriate page in documentation by typing the following command
web(fullfile(docroot, 'matlab/matlab_env/startup-options.html'))
This page can be viewed online at
http://www.mathworks.com/help/matlab/matlab_env/startup-options.html
2 Kommentare
Bruno Luong
am 2 Nov. 2018
Something even more fischy: I'm able to add/save my path using the GUI but I cannot save if I open pathdef.m on editor.
The first thing I do when I install a new MATLAB version is to change the privilege of pathdef.m
This is some of the thing that is totally annoying and illogical as design.
Guojin Feng
am 26 Nov. 2018
I had the same requirement on a Linux machine, on which there are multiple users and I am not allowed to save the path. i have tried the matlab /r (username)_path method, however, it doesn't work for me.
After some search and trial, I find the method below works for me.
1) cd to the folder containing pathdef.m
2) Start matlab with the command: matlab -r "path(pathdef)"
Matlab will run the command path(pathdef) after it starts. The pathdef.m is a file saved when I tried to save path through Set Path diaglogue.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!