Question

I have a big array (1024x1024x360) and I want to save it to a mat file. When I just try

A=rand(1024,1024,360)
save('filename.mat','A');

The variable is created in the workspace, the file is being created, but it remains empty... I'm using Matlab 2012a on Win7-64 machine, Why is that happening?

Was it helpful?

Solution

Earlier versions of Matlab couldn't save variables larger than 2 GB. Your default save file format may be set to an older type even on newer versions of Matlab; my own install of R2013a seems to have come preset to v7, which won't save anything that big. You have two choices: either specify the format for this file using an extra flag:

save('filename.mat','A','-v7.3');

or change the default for all save files by running preferences and looking in the MAT-files area under General.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top