I have a 25x4x3 Cell Array which I have saved into a .mat file and now need to load into Python.
A simple .mat file I am familiar with, but being new to Python, this problem is a little over my head. The 25 dimensions and 4 dimensions represent integers that I need to call later in my code. The 3 dimension in the cell array contains a list of datetime arrays, data, and then more character arrays of labels for that data.
e.g. (pseudocode)
.mat(1,1,1) = datetime arrays;
.mat(1,1,2) = data corresponding to datetime arrays;
.mat(1,1,3) = labels for each column in that data.
Obviously I need to load this into Python with loadmat('.mat') and then I get confused because my variable explorer does not show the .mat file. I have no idea how to pick apart the contents to correctly convert datettime indices accordingly, numbers to floats, etc.
Any guidance would be appreciated!
Right now I simply have:
filemat = 'Pdata.mat'
Pdata = sio.loadmat(filemat)
It is loading the .mat as an object from what I can tell.
Pdatashould be a dictionary,Pdata['mat']should be the object encoding yourmatcell. Because it comes from acellwith mixed data, it won't be a simplenumpynumeric array. Previousloadmatquestions have demonstrated how to extract information from such structures (see the side bar). You may have to show us the variable (if it's not too big).