Problem to load a path

9 次查看(过去 30 天)
Hugo Mendonça
Hugo Mendonça 2020-1-24
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 个评论
Jakob B. Nielsen
Jakob B. Nielsen 2020-1-24
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 2020-1-27
Thank you, Jakob.
As you said, it is not a pretty solution, but it avoids loading manually every time userpath.
Regards.

请先登录,再进行评论。

回答(1 个)

Cam Salzberger
Cam Salzberger 2020-1-24
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 个评论
Cam Salzberger
Cam Salzberger 2020-1-27
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 2020-1-28
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

请先登录,再进行评论。

类别

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

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by