MATLAB 2019a cannot add to search path
8 次查看(过去 30 天)
显示 更早的评论
I am currently unable to add a directory to the MATLAB2019a search path (Windows install). This problem is new. I had been able to use the addpath() function in 2019a without issue until recently when it suddendly stopped working. I also have MATLAB 2018b installed on the same Windows machine and I have no problem adding to the search path in that version of SW.
Procedure:
Create a directory called '.\fname\'
Open MATLAB2019a
>>pathtool (leave GUI open)
>>addpath('.\fname\')
>>which userpath = C:\Program Files\MATLAB\R2019a\toolbox\local\userpath.m
I can check in the pathtool GUI and I can see that the search path does not get added. I cannot add the path from the GUI either (nothing happens). This is resulting in code I have written failing since it cannot access functions outside the working directory or the list stored in C:\Program Files\MATLAB\R2019a\toolbox\local\userpath.m. When I run this same procedure in MATLAB 2018b on the same machine the search path is added.
This problem appears to be related to my system because I also have MATLAB 2019a installed on a remote Windows server. I am able to add to the MATLAB search path without issue on that machine. I have attempted MATLAB restoredefaultpath and rehash but neither resolved my issue.
2 个评论
Andrew Janke
2020-1-31
Sounds like your installation might have it so that you don't have write permission to userpath.m.
Could you do your path modifications in a user startup.m instead? That might be a more robust/flexible solution anyway.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!