MATLAB 2019a cannot add to search path

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 commentaires

Andrew Janke
Andrew Janke le 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 le 13 Fév 2020
Thank you for your reply. I uninstalled and reinstalled MATLAB and it resolved the issue.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Centre d'aide et File Exchange

Produits

Version

R2019a

Commenté :

le 13 Fév 2020

Community Treasure Hunt

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

Start Hunting!

Translated by