取消引用 hdf5 格式?

De-referening an hdf5 format?

我正在使用两种不同的语言,即 Matlab 和 python。我在 Matlab 中创建了 5 个变量。每个变量都有一个大小为 (150x1) 的单元格,如下所示:

每个单元格的大小为 (128 x (:)),如下所示:

我使用 hdf5 格式的 -v7.3 将此工作区保存到 .mat 文件中。

在 python 中,我使用 h5py 加载了 .mat 文件。我能够加载变量,但无法从每个变量中提取值。

我收到此语句 "array([[], dtype=object)",但这些值未加载到 python 工作区中。我想将所有 150 个单元格 o 加载到变量 A 中。如何取消引用 hdf5 引用?

也许您应该将数据保存在常规的 hdf5 文件中。 .mat文件是基于hdf5的,但不是普通的hdf5文件

在 MATLAB 中,您可以使用 http://es.mathworks.com/help/matlab/import_export/exporting-to-hierarchical-data-format-hdf5-files.html

要取消引用,请使用:

f[ref]

其中 fh5py.File 对象,ref<HDF5 object reference> 对象。

h5py documentation on references