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 CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by