Cannot save really big matrix in Matlab

本小妞迷上赌 提交于 2019-12-07 07:30:51

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/16226803/cannot-save-really-big-matrix-in-matlab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!