is it possible to append if file doesnt already exist?
13 views (last 30 days)
Show older comments
is it possible that matlab creates the file if it doesnt exist in append mode? i run a program which produces gb's of data. so i keep saving the variables in a file in steps and clear the variables.so i use append. but it says "Unable to write file samp.mat: No such file or directory." i use save function.
0 Comments
Accepted Answer
Jan
on 20 Dec 2011
The save command needs an existing file for appending. This can be caught easily:
if exist(FileName, 'file')
save(FileName, '-append');
else
save(FileName);
end
It could be much faster to write a binary file using FPRINTF.
More Answers (0)
See Also
Categories
Find more on Environment and Settings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!