Why MATLAB R2021a always creates a "Users\(user name)\AppD​ata\Roamin​g\MathWork​s\MATLAB\R​2021a" folder in disk E:?

I've installed MATLAB R2021a in disk D:, and I've kept my "AppData" folder at the default directory "C:\Users\(user name)\AppData". There DOES exist a folder "C:\Users\(user name)\AppData\Roaming\MathWorks\MATLAB\R2021a", but every time I use MATLAB R2021a, it creates a folder in disk E: with the directory "E:\Users\(user name)\AppData\Roaming\MathWorks\MATLAB\R2021a". This folder contains nothing and occupies 0 byte. Any other application does not create a similar folder in disk E:, either. What should I do to solve this problem?

Answers (1)

You may try executing
userpath /my/custom/location
and then restart MATLAB.

8 Comments

Thanks for your advice, but I tried just now, and it said
Error using userpath>setUserPath (line 88)
Invalid directory or directory does not exist
Error in userpath (line 50)
setUserPath(inArg);
after executing the command. Is ther any other possible solution?
Yeah. Same to me. On my Windows system Matlab always creates
D:\Users\<Username>\AppData\Roaming\MathWorks\MATLAB\R2021a
everytime i exit Matlab !
It was installed to C:\ but my matlab program i opened is on D:\
Why does Matlab even create a Users folder? Since we are working with network folders we have now this folders everywhere. This is really annoying and I am thinking to downgrade back to R2020a.
BTW, I get the same error message as @EcoRI. Really looking forward for a practical solution.
Especially in a networked context, it is not strange for a program to put files in the Roaming folder.You could check if your Windows settings might be to blame by checking where %AppData% is pointing to.
This does not solve the problem. In my Windows settings %AppData% is pointing to C:\Users\spda\AppData\Roaming. There is also a subfolder 'MathWorks\MATLAB\R2021a' which contains several files such as 'matlabprefs.mat'.
But still MATLAB creates an empty folder 'S:\Users\spda\AppData\Roaming\MathWorks\MATLAB\R2021a' anytime it starts up.
I'm just guessing here: did you check the Matlab path settings? That normally should warn for non-existing folders, but maybe it could attempt to create such a folder?
Otherwise I would suggest contacting support and/or filing a bug report.
I checked the path settings. I just filed a bug report.
Here is the answer from the MathWorks support:
Our development team is aware of this issue. Besides, the issue has already been resolved in the upcoming release of MATLAB (R2021b), but a robust solution does not currently exist for R2021a. Unfortunately, this means my best recommendation is to stick with an earlier release of MATLAB in which this issue is not present (R2020b or earlier) until the full release of MATLAB R2021b.
I changed the folder to "hidden".

Sign in to comment.

Categories

Products

Release

R2021a

Asked:

on 28 Mar 2021

Commented:

on 22 Apr 2021

Community Treasure Hunt

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

Start Hunting!