MATLAB Answers

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

조회 수: 17(최근 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일
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일
@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
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
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일
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!

태그

Community Treasure Hunt

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

Start Hunting!

Translated by