I am using the following Matlab code to import my kinematicreachability data into matlab:
function [a] = loadpickle(filename)
error('%s is not a file',filename);
outname = [tempname() '.mat'];
pyscript = ['"import cPickle as pickle;import sys;import scipy.io;file=open(""' filename '"",""rb"");dat=pickle.load(file);file.close();scipy.io.savemat(""' outname '"",dat);"'];
system(['python -c ' pyscript ]);
a = load(outname);
Basically all it does is call python to open the *.pp file and save it to a *.mat, and then subsequently loads that *.mat file. However, I am getting an Unpickling Error:
Traceback (most recent call last):
File "<string>", line 1, in <module>
cPickle.UnpicklingError: invalid load key, 'H'.
Is the *.pp a normal pickle file, or is there a better way to get the data into matlab without running the whole process again?
EDIT: It looks like the documentation says it is still a python pickle, but it is actually a hdf5 file. I can import it into Matlab using