Error using copyfile, Cannot write to destination

146 ビュー (過去 30 日間)
Jelle Kramer
Jelle Kramer 2021 年 10 月 21 日
回答済み: Bryant Lash 2021 年 10 月 21 日
Really hoping someone can help. Matlab (version 2021b) seems unable to write to destination folders. When using the
copyfile
command, I get the following error in my command window:
Error using copyfile
Cannot write to destination: C:\Users\...
Use the 'f' option to override.
Where of course the dots (...) represent the actual folder that Matlab is trying to write to. It would be really helpful if someone could help me fix this error. Thanks in advance!

回答 (1 件)

Bryant Lash
Bryant Lash 2021 年 10 月 21 日
So it's telling you what to do in that function. In stead of using
copyfile(source,dest);
you have to use
copyfile(source,dest,'f');
to force the copy. If that doesn't work, then the issue is that matab doesn't have the right permissions and you'll have to open matlab as admin.
If that still doesn't work, I imagine windows can't copy there either and it's a great lock that windows is placing on that location - there's nothign (reasonable) that can be done about it from matlab.

カテゴリ

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

タグ

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by