.mat文件的压缩 [英] Compression of the .mat file

查看:388
本文介绍了.mat文件的压缩的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将.mat文件压缩为.zip并减小其大小。当前大小为8MB。压缩为.zip不会改变其大小。还尝试使用dlmwrite压缩到文本文件,然后压缩。这样做从8获得了3MB,但我可以使用的最大为2MB。有什么方法可以将文件压缩到2MB以下吗?还有其他保存功能吗?

I need to compress my .mat file to .zip and reduce it's size. It's current size is 8MB. Compressing to .zip doesn't change it's size. Also tried compressing to text file using dlmwrite and then zipping. Doing that achieved 3MB from 8, but the maximum I can use is 2MB. Is there any way to compress the file to less than 2MB? Any other saving functions?

推荐答案

不幸的是,Matlab很少提供压缩控制方式。默认情况下,所有最新版本的Matlab均保存压缩。您还可以选择不进行压缩保存

Unfortunately, Matlab offers very little in the way of compression control. By default, all recent versions of Matlab save with compression. You also have the option to save with no compression:


保存(文件名,变量,版本,'-nocompression')将变量
保存到MAT文件,而无需压缩。仅
的 -nocompression标志支持MAT文件7.3版。因此,您必须将版本指定为
'-v7.3'。 variables参数是可选的。

save(filename,variables,version,'-nocompression') saves the variables to the MAT-file without compression. The '-nocompression' flag only supports MAT-file Version 7.3. Therefore, you must specify version as '-v7.3'. The variables argument is optional.

您可以尝试的一个选项是不进行压缩保存(如上所述),然后尝试使用不同的压缩工具,看看是否可以从外部将未压缩的 .mat 文件压缩得更小。我建议尝试使用一种具有现代高度压缩格式的东西,例如 bzip2 PAQ 。坦白地说,Matlab可能正在对可能胜过这些数字数据的数字数据进行一些自定义压缩(尝试使用它仍然不会受到伤害)。

One option you could try, is to save with no compression (as above), and then try using different compression tools to see if you can externally compress the uncompressed .mat file smaller. I would suggest trying something that boasts a modern highly-compressed format, such as bzip2 or PAQ. Honestly thought, Matlab is probably doing some custom compression for numeric data that might beat those (still wouldn't hurt to try).

这篇关于.mat文件的压缩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆