ndarkness
ndarkness

Reputation: 1089

Read .mat files in python whose content is a table

I was wondering whether I can read in Python a .mat file that contains a Table, is that possible?

I have read this post, but not much is mentioned there.

So far I have tried to read my .mat that contains the table in this way

import tables
from scipy.io import loadmat
from scipy.io import whosmat

x = loadmat('CurrentProto.mat')

print(x)

but I cannot address the elements there, I get this with the command print(x)

{'__header__': b'MATLAB 5.0 MAT-file, Platform: PCWIN64, Created on: Mon Jul 29 09:47:17 2019', '__version__': '1.0', '__globals__': [], 'None': MatlabOpaque([(b'CurrentProto', b'MCOS', b'table', array([[3707764736],
       [         2],
       [         1],
       [         1],
       [         1],
       [         1]], dtype=uint32))],
             dtype=[('s0', 'O'), ('s1', 'O'), ('s2', 'O'), ('arr', 'O')]), '__function_workspace__': array([[ 0,  1, 73, ...,  0,  0,  0]], dtype=uint8)}

Is there a way of reading my table in the .mat file or I have to sabe it in a different format within Matlab?

Upvotes: 5

Views: 2187

Answers (0)

Related Questions