MATLAB Answers

Problem to load a path

35 views (last 30 days)
Hugo Mendonça
Hugo Mendonça on 24 Jan 2020 at 11:30
Commented: Hugo Mendonça on 28 Jan 2020 at 10:51
Hi, everyone!
I have a little issue with my Matlab. I run the release 2019b in OsX.
The problem is every time I start it, all of my paths previously saved is erased because Matlab cannot recognize a character in the path.
E.g.:
Warning: Name is nonexistent or not a directory: /Users/PolitXcnica ...
the X represents what is in the system "é".
As a result, I always have to load all of the paths when I start Matlab.
PS: I cannot change the name "Politécnica".
I appreciate any help.

  2 Comments

Jakob B. Nielsen
Jakob B. Nielsen on 24 Jan 2020 at 11:58
Because I am a slob and have saved a bunch of subfunctions in a hundred different folders, I have taken to start all my scripts with
addpath(genpath('C:\Users\MYID\thetoplevelfolderofmyMATLAB'))
It is probably not pretty at all - but might work?
Hugo Mendonça
Hugo Mendonça on 27 Jan 2020 at 9:47
Thank you, Jakob.
As you said, it is not a pretty solution, but it avoids loading manually every time userpath.
Regards.

Sign in to comment.

Answers (1)

Cam Salzberger
Cam Salzberger on 24 Jan 2020 at 16:00
I haven't seen this before, though it looks similar to this issue with opening files. If I were to guess at a solution...
This looks like it's your userpath that gets automatically added to the top of the MATLAB Search Path upon startup. If you don't store files there that need to be available on the search path, you can just remove it:
userpath('clear')
Alternatively, you could set up a different folder somewhere without a non-ASCII character on the full path to serve as your user path, and set it to use that in the future:
userpath('/some/other/folder')
-Cam

  5 Comments

Show 2 older comments
Hugo Mendonça
Hugo Mendonça on 27 Jan 2020 at 14:21
Second option! My matlab files are in this folder which is an intitutional OneDrive account. As I work in several computers, I can easily access files in the cloud.
Cam Salzberger
Cam Salzberger on 27 Jan 2020 at 16:47
Ah, I understand that the path is both required and unable to be renamed. In that case, since it seems like the addpath functionality works (it just won't persist the changes between sessions), you could add a "startup.m" file somewhere on the path (whatever part of the path does stay around), and call the addpath commands in that file. This is a little easier than remembering to "addpath" at the beginning of each script.
I would suggest contacting technical support to ensure that they understand the issue you have been encountering, and see if they are already aware of it, or if it's different from the bug-report I linked in my first post.
-Cam
Hugo Mendonça
Hugo Mendonça on 28 Jan 2020 at 10:51
Thank you again, Cam!
I did something similarly. I've created a shortcut with Jakob's suggestion, so with a only click I have it.
Regards,
Hugo

Sign in to comment.

Sign in to answer this question.

Products


Release

R2019b