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
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.
Ryan Sosovec
Ryan Sosovec 2020-2-13
Thank you for your reply. I uninstalled and reinstalled MATLAB and it resolved the issue.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

标签

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by