Error using save Unable to write file datafiles/f01.mat: No such file or directory.
Show older comments
keep getting this error for simple save function. heres my code
if (jrandflag == 1) o = jrand.createShiftVector(D, lb, ub); o = o'; save('datafiles/f01.mat', 'o'); else load('datafiles/f01.mat'); o = o(1:D); end
datafiles folder does exist in same directory; expect'd save function to create f01.mat but error every time. and code not in loop per se
Can anyone help please? Thanks
Matlab version 7.10.0.499 (R2010a) on windows platform
Accepted Answer
More Answers (1)
Bart Van Hove
on 12 Jan 2018
2 votes
When my MATLAB (2014b) has been running for a while (days), sometimes the current folder disappears from the path (have not verified if this is exactly what happens). Running scripts, functions, loading files... continues to work, but saving to subdir/file.mat does not. Moving up 1 directory in the MATLAB file browser and re-entering the current folder resolves the issue for me. Saving with a full path as suggested by Jiang avoids this issue, but I'm still curious why it occurs.
2 Comments
Alessio
on 31 Jul 2018
I experienced the same issue with R2014b, and the workaround is the same. I'm curious if they fixed it on next versions.
Henry Brice
on 26 May 2023
I can confidently say that in 2023, with version R2023a, this is still a problem!
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!