setpath not working on 2015a

2 次查看(过去 30 天)
Mathieu NOE
Mathieu NOE 2015-6-18
回答: Jan 2015-6-20
Hi
I have upgraded to ML 2015a I wanted to add my toolboxes in the path but I always get an error that "pathdef.m" could not be saved as if I had not the rights to do it, even if I am running as Administrator. Even could not save it at any location in my PC - always denied permission. I have WIN 7 / 32 bits FYI, I have installed the new release under C:\Program Files\MATLAB\R2015a

采纳的回答

Jan
Jan 2015-6-20
I had the same problem with several other Matlab versions. When pathdef.m is inside the folder matlabroot\toolbox\local\ , only the system account has privileges to write, not the admin. But the admin can obtain the privileges for writing using the security tab of the folder's context menu. After providing the write access to the admin, addpath works successfully, when Matlab is started as an admin also.
Note that using pathdef.m inside the program folder concerns all users of this computer. Therefore a pathdef.m file in the userpath helps to avoid conflicts between users.

更多回答(1 个)

cwshep
cwshep 2015-6-20
You shouldn't be modifying pathdef.m directly, as it says:
% DO NOT MODIFY THIS FILE. IT IS AN AUTOGENERATED FILE.
% EDITING MAY CAUSE THE FILE TO BECOME UNREADABLE TO
% THE PATHTOOL AND THE INSTALLER.
You should set your path by using "addpath" and "savepath" or "pathtool".
However, there is nothing that should be preventing you from modifying the pathdef.m file directly (I just checked on Win7/2015a). It is likely that it is being accessed by another program (perhaps java itself), and you just need to reboot to make sure nothing else has it locked.

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by