Ich habe eine Struktur Array von Matlab erstellt und in v7.3 Format mat-Datei gespeichert:Wie liest man eine v7.3-Mat-Datei über h5py?
struArray = struct('name', {'one', 'two', 'three'},
'id', {1,2,3},
'data', {[1:10], [3:9], [0]})
save('test.mat', 'struArray', '-v7.3')
Jetzt möchte ich diese Datei über Python lesen mit h5py:
data = h5py.File('test.mat')
struArray = data['/struArray']
Ich habe keine Ahnung wie die Struktur-Daten nacheinander von struArray
zu bekommen:
for index in range(<the size of struArray>):
elem = <the index th struct in struArray>
name = <the name of elem>
id = <the id of elem>
data = <the data of elem>
Haben Sie eine tatsächliche Lösung hierfür finden? – Pastafarian
Ich hatte eine ähnliche Frage, mit einer Teillösung: http://StackOverflow.com/Questions/29852481/Reading-All-Variables-in-Amat-File-with-Python-H5py/29856030#29856030 – CodyF