Why is it sometimes impossible to save the pathdef in 2014a?
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaire
kaare
le 5 Sep 2014
Modifié(e) : kaare
le 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.
Réponses (13)
Jim Hokanson
le 19 Déc 2016
Modifié(e) : Jim Hokanson
le 19 Déc 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 commentaire
Jan
le 19 Déc 2016
Modifié(e) : Jan
le 11 Mar 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.
John Murphy
le 23 Juil 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.
1 commentaire
Renzo Lanfranco
le 1 Mar 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 commentaire
Stefan Oline
le 17 Juin 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.
Jan
le 25 Avr 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 commentaires
Stefan Oline
le 18 Juin 2019
Modifié(e) : Stefan Oline
le 18 Juin 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
le 19 Juin 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?
Saeedeh Amirmohseni
le 25 Avr 2014
4 commentaires
Malin
le 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
le 19 Déc 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.
Ken Atwell
le 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.
kaare
le 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".
0 commentaires
Sébastien MAILFERT
le 16 Juil 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 commentaire
Jan
le 19 Déc 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.
Qiaosheng Zhang
le 18 Oct 2017
There is some functions maybe have the same name as the built-in function's. Find them and change the function name
0 commentaires
Jack Beggs
le 18 Déc 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 commentaire
A Jorge
le 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.
Deepa Gupta
le 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.
0 commentaires
Walter
le 11 Mar 2018
Modifié(e) : Walter
le 11 Mar 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 commentaire
Jan
le 11 Mar 2018
Modifié(e) : Jan
le 11 Mar 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.
Renzo Lanfranco
le 1 Mar 2019
I'm having exactly the same problem with MATLAB 2018a, and also with EEGLAB. None of the solutions suggested works. Please, help!
0 commentaires
Voir également
Catégories
En savoir plus sur Startup and Shutdown dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!