pyigal
pyigal

Reputation: 389

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

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?

Upvotes: 1

Views: 6014

Answers (1)

hpaulj
hpaulj

Reputation: 231665

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.

Upvotes: 1

Related Questions