我有MATLAB創建並存儲在7.3版格式墊文件一個結構數組:如何通過h5py讀取v7.3 mat文件?
struArray = struct('name', {'one', 'two', 'three'},
'id', {1,2,3},
'data', {[1:10], [3:9], [0]})
save('test.mat', 'struArray', '-v7.3')
現在我想用h5py讀通過Python這個文件:
data = h5py.File('test.mat')
struArray = data['/struArray']
我不知道如何從struArray
一個的結構數據之一:
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>
你找到這樣的一個實際的解決方案? – Pastafarian
我有一個類似的問題,與部分解決:http://stackoverflow.com/questions/29852481/reading-all-variables-in-a-mat-file-with-python-h5py/29856030#29856030 – CodyF