Why is it sometimes impossible to save the pathdef in 2014a?

7 Ansichten (letzte 30 Tage)
Saeedeh Amirmohseni
Saeedeh Amirmohseni am 25 Apr. 2014
Kommentiert: A Jorge am 26 Sep. 2020
I think the toolbox of MATLAB is not completely added to the pathdef.m. When I add the toolbox and try to save it, pops up a window, that MATLAB can not save the changes, since the file is read-only, or I might not have access to it. The pathdef is in toolbox\local, and I have administrator rights. Trying to save the path in other place is not possible too. Any ideas on this? P.S: I have noticed, that with adding smaller files, saving the pathdef.m is possible.
  1 Kommentar
kaare
kaare am 5 Sep. 2014
Bearbeitet: kaare am 5 Sep. 2014
I have the same problem - changing ownership, user rights etc. has no effect. I can edit pathdef.m manually, but from inside matlab it is impossible. starting matlab as administrator has no effect.
-edit: it appears that the problem was with the specific package that I was attempting to add to the path.

Melden Sie sich an, um zu kommentieren.

Antworten (13)

Jim Hokanson
Jim Hokanson am 19 Dez. 2016
Bearbeitet: Jim Hokanson am 19 Dez. 2016
A colleague of mine was having this issue. I was going to suggest to them that they edit their startup.m file to add all the paths on startup. However, typing 'edit startup' also failed, with an error in strtok.m. It turns out, they had previously added a toolbox with its own custom functions (like strtok.m) that were interfering with some pretty basic Matlab functionality. Removing the offending toolbox (EEG lab) and redownloading it with a newer version fixed the problem.
I think the main take home with this is that the error may not be permissions based, but that any code failure is being caught, and a generic (and perhaps not appropriate/accurate) error message is being thrown.
  1 Kommentar
Jan
Jan am 19 Dez. 2016
Bearbeitet: Jan am 11 Mär. 2018
@Jim: A good idea. I've looked on the screenshot of Saeedeh again. In fact, there is a long list of warnings for duplicate function names in the background. What a pitty that they have been ignored in the discussion.

Melden Sie sich an, um zu kommentieren.


John Murphy
John Murphy am 23 Jul. 2018
I was having this same issue and found the source of the error on my machine:
Try running the command "savepath" from the command line rather than from the Matlab "Set Path" option.
For me, this showed that the built-in function "isdir" was replaced by some File Exchange code that I was using, and that code had an error. After removing those files, "savepath" was able to use the correct "isdir", and I was able to save the path again. After this fix, saving the path worked both from the command line and using the "Set Path" dialogs.

Renzo Lanfranco
Renzo Lanfranco am 1 Mär. 2019
I found a viable solution (at least when it's the EEGLAB toolbox): you can add every subfolder manually, one by one. The error only takes place when you try to add all the subfolders at once.
Why? No idea. But it works doing it one by one.
  1 Kommentar
Stefan Oline
Stefan Oline am 17 Jun. 2019
THIS WORKED FOR ME! WHY?!?!?!
At least it's a work around. I had the problem exactly as described, after upgrading from 2018a to 2019a.

Melden Sie sich an, um zu kommentieren.


Jan
Jan am 25 Apr. 2014
The question is not clear to me.
Even with admin privileges you have limited access for subfolders of the local program folder. I usually gain write access to the local/ folder for all Matlab users manually.
What does this mean exactly:
Trying to save the path in other place is not possible too.
Please show us the corresponding code.
What is "adding smaller files"?
  2 Kommentare
Stefan Oline
Stefan Oline am 18 Jun. 2019
Bearbeitet: Stefan Oline am 18 Jun. 2019
Hi Jan,
I just upgraded from 2018a to 2019a and I'm having the same issue that the OP is. Since he hasn't replied in two months, I'm writing to help keep the thread alive.
I have the problem as described: When I add folders and subfolders with the GUI, they do change color and are no longer greyed out, as expected. However, once I select the "Set Path" icon in the Environment section of the Home tab, pressing Save throws this error. However, as noted by Renzo, if I only select a folder and not subfolders, I am able to save.
I should add that I do have administrator access, and this problem persists even if I open it with admin rights.
I'd really appreciate help getting this working, otherwise I've got to go back to 2018a.
Thanks!
Stefan
Jan
Jan am 19 Jun. 2019
@Stefan Online: I do not understand your comment exactly.
"add folders and subfolders with the GUI, they do change color" - How do you add folders and subfolders with which GUI and where do which color change?
"pressing Save throws this error" - which error message do you get?
"problem persists even if I open it with admin rights" - if you open what?

Melden Sie sich an, um zu kommentieren.


Saeedeh Amirmohseni
Saeedeh Amirmohseni am 25 Apr. 2014
"What does this mean exactly:
Trying to save the path in other place is not possible too." It means, I have tried to save the path under documents\MATLAB too, or at the desktop... just the window pops up every time. Adding smaller files means, means I could add and save some of the subfolders of Toolbox, but when I want to save the whole Toolbox, it just doesn't work. So I think it have nothing to do with Admin privilages. Could it be, that saving too many lines in the pathdef under some circumstances is not possible?
  4 Kommentare
Malin
Malin am 23 Mai 2014
I have the same problem with Matlab R2014a on Win8.1 I can't save the path and get the same error message. When I try to save pathdef.m it in a different location the same message pops up again. I have full administrator rights and have tried running Matlab as administrator but that did not help. I've also checked that i have full rights on all files and folder.
Jan
Jan am 19 Dez. 2016
@Saeedeh: Do you see the bunch of warnings in Matlab's command window in the background? Obviously there is a severe problem and Matlab tries desperately to tell you the details. Some functions shadow built-in functions and this can cause serious troubles. Do not ignore these warning only because there is an error message in the foreground also.
Why do you add matlabroot\toolbox to the path? This folder should not contain any functions.

Melden Sie sich an, um zu kommentieren.


Ken Atwell
Ken Atwell am 4 Mai 2014
Next time you start MATLAB, navigate to it in the Start Menu (contextual clues tell me you're on Windows) and right-click->"Run as Administrator". Now you should be to overwrite pathdef.m.
I don't recommend running as Administrator unless you're in a situation where you really need to be one (like now). MATLAB is an open-end scripting/programming environment, and with Administrator access a mistyped shell command can reek havoc on your computer.
  1 Kommentar
Saeedeh Amirmohseni
Saeedeh Amirmohseni am 5 Mai 2014
Hi Ken, Thank you for the tip. This hasn't helped too. As mentioned before, overwriting in general is not a problem, since I can add some folders.

Melden Sie sich an, um zu kommentieren.


kaare
kaare am 5 Sep. 2014
have you tried with other folders? the error message is it a bit vague, but in fact you can also get it if there is something in the folder that can't be added to the path. that might explain why you don't have any problems with "small amounts".

Sébastien MAILFERT
Sébastien MAILFERT am 16 Jul. 2015
Dear all, I have exactly the same problem, not on 2012b but with 2014a. I can set the path, save it to the pathdef.m file but when I close Matlab and open it, the paths are not saved anymore.
Help please!!!! Séb
  1 Kommentar
Jan
Jan am 19 Dez. 2016
This is a different problem. The descriptions of the OP have been too lean already to help him. Attaching a new question in the answers section of this thread is a bad idea.

Melden Sie sich an, um zu kommentieren.


Qiaosheng Zhang
Qiaosheng Zhang am 18 Okt. 2017
There is some functions maybe have the same name as the built-in function's. Find them and change the function name

Jack Beggs
Jack Beggs am 18 Dez. 2017
I was able to resolve this issue by copying the Pathdef.m file out of the Matlab Application folder ("Show Package Contents" on a Mac, under Matlab_R20xxb.app\toolbox\local), opening the file with a script editor, and adding the path to the toolbox there, and saving it. Then, copy it back into your Matlab_R20xxb.app\toolbox\local folder and overwrite the existing pathdef.m file. After doing this your added plugins should load by default.
  1 Kommentar
A Jorge
A Jorge am 26 Sep. 2020
What worked for me: For mac IOS users (and maybe linux), simply go to the Pathdef.m file out of the Matlab Application folder ("go to your applications folder, right click on Matlab and Show Package Contents" on a Mac, under Matlab_R20xxb.app\toolbox\local). Navigate to this folder address, right click pathdef.m file, click get info, unlock the lock with your password at the bottom (you need admin privileges here I believe) and change the Privilege column at the very bottom from Read to Read & Write. You need to restart matlab for the change to take effect.

Melden Sie sich an, um zu kommentieren.


Deepa Gupta
Deepa Gupta am 25 Jan. 2018
Thank you for posting this. I re-installed my matlab and am still facing exactly the same issue (screenshot posted by Saeedeh). I tried Jack's solution but matlab is not letting me save pathdef in another location either. so, this is not working for me. I am using 2017b version. If anybody can share any suggestions, it will be greatly appreciated. Thank you in advance.

Walter
Walter am 11 Mär. 2018
Bearbeitet: Walter am 11 Mär. 2018
I am having the same problem with Matlab 2017b. Matlab2016b works fine, however, it would be very nice if the newer version of Matlab worked better than previous.
I am also having an error with fullfile for any code that uses it.
  1 Kommentar
Jan
Jan am 11 Mär. 2018
Bearbeitet: Jan am 11 Mär. 2018
Please do not inject a new question to an existing thread. This "thread-hijacking" confuses readers, because it is not clear anymore, to which question an answer belongs. Open a new thread instead by asking your own question.
The error message is clear already: One of the inputs o fullfile is a string object, but it accepts char vectors only. The code posted as screenshot does not contain the failing line, so the readers cannot guess where this string is coming from.

Melden Sie sich an, um zu kommentieren.


Renzo Lanfranco
Renzo Lanfranco am 1 Mär. 2019
I'm having exactly the same problem with MATLAB 2018a, and also with EEGLAB. None of the solutions suggested works. Please, help!

Kategorien

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

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by