Matlab doesn't have same rights as user

2 ビュー (過去 30 日間)
kaare
kaare 2016 年 12 月 26 日
回答済み: kaare 2017 年 1 月 9 日
I'm sitting on a fresh installation of 2015b on windows 10. For some reason, I can't write to the Documents folder from inside matlab? My user has ownership of the folder, and both administrators, the user and SYSTEM has "full control". Running matlab as administrator does not change anything. I can edit files in Documents from other programs (or, at least wordpad) with no problems. The result is the same whether I try editing existing files, or saving new ones. Apparently, matlab is still able to write to the desktop folder, but I can't see what the difference between the two locations is.
any ideas?
edit: more precisely, I can not, from within matlab, write to C:\Users\kaare\Documents\MATLAB or C:\Users\kaare\Documents\
("kaare" being the username)
my current work-around is to save pathdef.m to the desktop, and then move it manually to C:\Users\kaare\Documents\MATLAB\
further edit:
here is the result when I try to perform the same operation from the command line, instead of the gui:
>> savepath
Warning: Unable to save path to file 'C:\Users\kaare\Documents\MATLAB\pathdef.m'.
You can save your path to a different location by calling SAVEPATH with an input
argument that specifies the full path. For MATLAB to use that path in future
sessions, save the path to 'pathdef.m' in your MATLAB startup folder.
> In savepath (line 204)
  4 件のコメント
Image Analyst
Image Analyst 2016 年 12 月 26 日
Please read this link and then show us the full error message, meaning ALL the lines of red text.
kaare
kaare 2016 年 12 月 27 日
this has been added to the original post

サインインしてコメントする。

採用された回答

kaare
kaare 2017 年 1 月 9 日
It turned out that the problem was caused by my antivirus, which included a "ransomware protection". Adding matlab.exe as a trusted program for that module solved the issue.

その他の回答 (1 件)

Shashank
Shashank 2016 年 12 月 29 日
' savepath' saves the full MATLAB search path to 'pathdef.m' file generally present in C:\Program Files\MATLAB\R2016b\toolbox\local if there is no 'pathdef.m' file in the current directory. It looks like you don't have write access there. So, to save it in a custom directory use : savepath folderName/pathdef.m
For example savepath C:\Users\kaare\Documents/pathdef.m
  1 件のコメント
kaare
kaare 2016 年 12 月 30 日
thank you for answering, shashank, but I already tried that (I also think that if there is a pathdef.m i in the documents\MATLAB-folder, then that takes precedence). the result of your suggestion is the same:
savepath C:\Users\kaare\Documents/pathdef.m
Warning: Unable to save path to file
'C:\Users\kaare\Documents/pathdef.m'. You can save your
path to a different location by calling SAVEPATH with an
input argument that specifies the full path. For MATLAB
to use that path in future sessions, save the path to
'pathdef.m' in your MATLAB startup folder.
> In savepath (line 204)

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by