1

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?

hpaulj
  • 221,503
  • 14
  • 230
  • 353
pyigal
  • 379
  • 5
  • 15
  • Do you have a (smaller) sample of the struct? – Jan May 28 '17 at 08:26
  • Tried `scipy.io.loadmat`? – Daniel May 28 '17 at 08:54
  • `scipy` `loadmat` can load Matlab matrix, cell and struct. - as dictionaries and numpy arrays. But at some level matlab switched to `HDF5`, in which case you have to use `h5py`. Do SO search on those terms. – hpaulj May 28 '17 at 09:08

1 Answers1

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.

hpaulj
  • 221,503
  • 14
  • 230
  • 353