I am using R2013b. I have the code:
save(savefilename, 'newP_hist', 'newO_hist', 'newE_hist', 'newt_hist'); save(savefilename, 'newLa_hist', 'newSm_hist', 'newYb_hist', '-append'); save(savefilename, 'newU238_hist', 'newU235_hist', 'newTh_hist', 'newRa_hist', 'newPa_hist', '-append');
where newP_hist, newO_hist, etc. are 840000×120 full matrices. The above code works correctly until it, apparently, tries to save the last variable 'newPa_hist' and I get the error "Error using save, can't write file…'. The resulting file, with the final variable missing, is about 4.37 GB. However, if I do not append the variables and just save the whole thing as:
save(savefilename, 'newP_hist', 'newO_hist', 'newE_hist', 'newt_hist', 'newLa_hist', 'newSm_hist', 'newYb_hist', 'newU238_hist', 'newU235_hist', 'newTh_hist', 'newRa_hist', 'newPa_hist')
Then it works. It also works if I change the order of what is saved in the original code, until the last variable is attempted to write. Whatever the last variable is, it will fail to append. However, it will be written if all the variables are included in one non-appending save command.
So, is matlab unable to append variables to files larger than ~4 GB? Or am I missing something else?
Thanks
Best Answer