Oct-06-2023, 08:28 PM
Hello,
I have some data stored in a matab file (data.mat). The data is stored in a table as shown in the following figure (screen shot from matlab).
[attachment=2593]
I use the following python code to read in the mat-file:
The mat-file is stored with Matlab version 9.7.0.1190202 (R2019b)
I have some data stored in a matab file (data.mat). The data is stored in a table as shown in the following figure (screen shot from matlab).
[attachment=2593]
I use the following python code to read in the mat-file:
import scipy.io as spio lib = spio.loadmat('data.mat') lib
Output:{'__header__': b'MATLAB 5.0 MAT-file, Platform: PCWIN64, Created on: Fri Oct 6 18:07:57 2023',
'__version__': '1.0',
'__globals__': [],
'None': MatlabOpaque([(b'data_test', b'MCOS', b'table', array([[3707764736],
[ 2],
[ 1],
[ 1],
[ 1],
[ 2]], dtype=uint32)) ],
dtype=[('s0', 'O'), ('s1', 'O'), ('s2', 'O'), ('arr', 'O')]),
'__function_workspace__': array([[ 0, 1, 73, ..., 0, 0, 0]], dtype=uint8)}
data_1=lib['__function_workspace__'][0] data_1
Output:array([ 0, 1, 73, ..., 0, 0, 0], dtype=uint8)
len(data_1)
Output:16056
When I read in the mat-file, I get a single vector, which makes no sense to me. Does anyone have an example of how to read in matlab files? I have attached table in the zip-file.The mat-file is stored with Matlab version 9.7.0.1190202 (R2019b)