MATLAB:.mat版本之间的差异 [英] MATLAB: Differences between .mat versions

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

问题描述

官方文档指出以下内容:

.但是我注意到,除了上表中所述的以外,还有其他重要的区别.

. But I have noticed that there are other important differences besides those stated in the table above.

例如,在MATLAB中保存一个包含约6,000个元素的单元格数组,这些元素占用 176 MB 的内存,根据我使用的是 -v7 还是 -v7.3 :

For example, saving a cell array with about 6,000 elements that occupies 176 MB of memory in MATLAB gives me the following results depending on whether I use -v7 or -v7.3:

  • 使用 -v7 :文件大小= 15 MB ,然后保存并保存加载快速.
  • 使用 -v7.3 :文件大小= 400 MB ,然后保存并保存负载非常 (部分原因是文件很大).
  • With -v7: File size = 15 MB, and save & load is fast.
  • With -v7.3: File size = 400 MB, and save & load is very slow (probably in part because of the large file size).

还有其他人注意到这些差异吗?

Has anybody else noticed these differences?

更新1 :正如答复所指出的那样, -v7.3 依赖于HDF5,并且根据Mathworks的说法,此格式的存储开销很大" ,尽管目前尚不清楚这种开销是否真的是由于格式本身,还是由于MATLAB的实现和对HDF5的处理.

Update 1: As the replies point out, -v7.3 relies on HDF5 and according to Mathworks, "this format has a significant storage overhead", although it's not clear if this overhead is really due to the format itself, or to the MATLAB implementation and handling of HDF5 instead.

更新2 :@ Andrew Janke指出我们这非常有用的PDF (在网络上显然无法以HTML格式提供).有关更多详细信息,请参阅@Amro提供的答案中的评论.

Update 2: @Andrew Janke points us to this very helpful PDF (which apparently is not available in HTML format on the web). For more details, see the comments in the answer provided by @Amro.

这一切将我带到下一个问题:有没有其他选择,它们结合了两个方面的优势(例如 -v7 的效率和应对能力- v7.3 )的超大文件?

This all takes me to the next question: Are there any alternatives that combine the best of both worlds (e.g. the efficiency of -v7 and the ability to deal with very large files of -v7.3)?

推荐答案

MAT文件的7.3版使用HDF5格式,这种格式具有很大的存储开销来描述文件的内容,尤其是对于复杂的嵌套单元格数组和结构而言.与MAT文件的早期版本相比,它的主要优点是可以在64位系统上存储大于2GB的数据.

Version 7.3 of MAT-files uses HDF5 format, this format has a significant storage overhead to describe the contents of the file, especially so for complex nested cellarrays and structures. Its main advantage over previous versions of MAT-files is that it allows storing data larger than 2GB on 64-bit systems.

请注意,v7和v7.3均被压缩并使用Unicode编码(与v6不同),但是它们是两种完全不同的格式...

Note that both v7 and v7.3 are compressed and use Unicode encoding (unlike v6), yet they are two completely different formats...

参考文献:

  • MAT-File Preferences
  • MAT-File Versions

这篇关于MATLAB:.mat版本之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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