Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
735 views
in Technique[技术] by (71.8m points)

matlab - issues of saving a large scale matrix to mat file

I was trying to save a matrix into a mat file, but the Matlab returns the following messages:

Warning: Variable 'listmatrix' cannot be saved to a MAT-file whose version is older than 7.3. To save this variable, use the -v7.3 switch. Skipping...

What does it mean for "use the -v7.3 switch"?

Should I use

save testresult.mat -v7.3 listmatrix

or sth else?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Hi i thought I’d reply to this thread as I’ve been trying to figure out how to save a large (>2 GB) .mat file in matlab v7 (v7.1.0.183) (R14) and finally found a solution.

If you try to use the save command you will get the following error:

save('test.mat', 'data');

Warning: Variable 'data' cannot be saved to a MAT-file because its storage requirements exceed 2^31 bytes. This limitation will be addressed in a future release. Consider storing this variable in HDF5 file format (see HDF5WRITE). Skipping...

The solution is to write a HDF5 file instead:

hdf5write('test.hdf5', '/dataset1', data);

You can then read the data back into matlab using:

hdf5read('test.hdf5', '/dataset1');

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...