I have a .mat
file which I load using scipy
:
from oct2py import octave
import scipy.io as spio
matPath = "path/to/file.mat"
matFile = spio.loadmat(matPath)
I get a numpy array which I want to pass to octave function using oct2py
, like that:
aMatStruct = matFile["aMatStruct"]
result = octave.aMatFunction(aMatStruct)
But I get the following error:
oct2py.utils.Oct2PyError: Datatype not supported
It seems it's due to the array dtype
, which looks like: [('x', 'O'), ('y', 'O'), ('z', 'O')]
So I thought about changing it to 'S'
, 'U'
, or something that's supported.
- How can it be done?
- I couldn't find a supported dtype in the otc2py documentation. Any help on that?
- Is there a way to load the
.mat
file with another (supported) dtype? I looked here but couldn't find anything useful.
Note that inside aMatFunction
it uses aMatStruct
like that: x = aMatStruct.x
.