MATLAB 2019a cannot add to search path

8 views (last 30 days)
Ryan Sosovec
Ryan Sosovec on 30 Jan 2020
Commented: Ryan Sosovec on 13 Feb 2020
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 Comments
Andrew Janke
Andrew Janke on 31 Jan 2020
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 on 13 Feb 2020
Thank you for your reply. I uninstalled and reinstalled MATLAB and it resolved the issue.

Sign in to comment.

Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!