Error using copyfile, Cannot write to destination
158 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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!
0 Kommentare
Antworten (1)
Bryant Lash
am 21 Okt. 2021
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.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!