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

8 ビュー (過去 30 日間)
Saeedeh Amirmohseni
Saeedeh Amirmohseni 2014 年 4 月 25 日
コメント済み: A Jorge 2020 年 9 月 26 日
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 件のコメント
kaare
kaare 2014 年 9 月 5 日
編集済み: kaare 2014 年 9 月 5 日
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.

サインインしてコメントする。

回答 (13 件)

Jim Hokanson
Jim Hokanson 2016 年 12 月 19 日
編集済み: Jim Hokanson 2016 年 12 月 19 日
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 件のコメント
Jan
Jan 2016 年 12 月 19 日
編集済み: Jan 2018 年 3 月 11 日
@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
John Murphy 2018 年 7 月 23 日
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 件のコメント
Jan
Jan 2018 年 7 月 24 日
You can find shadowed functions with this tool: FEX: UniqueFuncNames

サインインしてコメントする。


Renzo Lanfranco
Renzo Lanfranco 2019 年 3 月 1 日
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 件のコメント
Stefan Oline
Stefan Oline 2019 年 6 月 17 日
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
Jan 2014 年 4 月 25 日
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 件のコメント
Stefan Oline
Stefan Oline 2019 年 6 月 18 日
編集済み: Stefan Oline 2019 年 6 月 18 日
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 2019 年 6 月 19 日
@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
Saeedeh Amirmohseni 2014 年 4 月 25 日
"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 件のコメント
Malin
Malin 2014 年 5 月 23 日
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 2016 年 12 月 19 日
@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
Ken Atwell 2014 年 5 月 4 日
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 件のコメント
Saeedeh Amirmohseni
Saeedeh Amirmohseni 2014 年 5 月 5 日
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.

サインインしてコメントする。


kaare
kaare 2014 年 9 月 5 日
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 2015 年 7 月 16 日
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 件のコメント
Jan
Jan 2016 年 12 月 19 日
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
Qiaosheng Zhang 2017 年 10 月 18 日
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 2017 年 12 月 18 日
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 件のコメント
A Jorge
A Jorge 2020 年 9 月 26 日
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
Deepa Gupta 2018 年 1 月 25 日
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 2018 年 3 月 11 日
編集済み: Walter 2018 年 3 月 11 日
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 件のコメント
Jan
Jan 2018 年 3 月 11 日
編集済み: Jan 2018 年 3 月 11 日
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
Renzo Lanfranco 2019 年 3 月 1 日
I'm having exactly the same problem with MATLAB 2018a, and also with EEGLAB. None of the solutions suggested works. Please, help!

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by