In matlab, how to read a pyrene peak file?

In python, I generated a .p data file with

pickle.dump( allData, open( "myallData.p", "wb" )) 

Now I want to read myallData.p in Matlab. (My Matlab is installed under Windows 8, in which there is no python). Any ideas? Thanks in advance.

+8
source share
2 answers

I ended up reading data from a .p file:

 [whatever_data]=pickle.load( open( "myallData.p", "rb" ) ) 

Then use scipy to convert and save the data in .mat

 import numpy, scipy.io scipy.io.savemat('/home/myfiles/mydata.mat', mdict={'whatever_data': whatever_data}) 

So, not to deal with pickle.

+17
source

matlab and python pickle do not use the same format. You can use this writeup to format data in a way that Matlab can understand.

0
source

Source: https://habr.com/ru/post/1202642/


All Articles