how to load Matlab's struct (saved with v7.3) in Python

谁都会走 提交于 2021-02-10 14:19:35

问题


I created a 1X20 struct in Matlab. This struct has 9 fields. The struct is saved in -v7.3 version because of its dimensions (about 3 Giga). one of the fields contains 4D matrix, other contain cell arrays, meaning it is a complex struct. I would like to know if there is a way to load this struct into Python?


回答1:


MATLAB v7.3 uses HDF5 storage; scipy.io.loadmat cannot handle that

MATLAB: Differences between .mat versions

Instead you have to use numpy plus h5py

How to read a v7.3 mat file via h5py?

how to read Mat v7.3 files in python ?

and a scattering of more recent questions.

Try that, and come back with a new question it you still have problems sorting out the results.



来源:https://stackoverflow.com/questions/44225231/how-to-load-matlabs-struct-saved-with-v7-3-in-python

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