load .mat file from python
<p>I am trying to run from Python a script in Matlab that run a Simulink mode, save a variable as Power.mat and read this variable in Python. I am using Python 2.7 on Windows.</p>

<p>I've tried to use the library hdf5storage to read the file:</p>

<pre><code>import hdf5storage
x=hdf5storage.loadmat('Power.mat','r')
</code></pre>

<p>but I get the error attached.
<img src="https://i.stack.imgur.com/hHI33.png" alt="error"></p>

<p>Which could be the problem?
I have also tried with the library h5py but I get the same error. 
The file .mat seems not to be corrupted since I open it without any problem in Matlab.</p>

<p>Thanks!</p>

<p>You can use scipy.io to exchange data between Python and Matlab. There are functions named savemat and loadmat for this purpose. </p>

<p>Something like this should work:</p>

<pre><code>import scipy.io
mat = scipy.io.loadmat('Power.mat')
</code></pre>

<p>For reference, <a href="http://docs.scipy.org/doc/scipy/reference/generated/scipy.io.loadmat.html" rel="nofollow">http://docs.scipy.org/doc/scipy/reference/generated/scipy.io.loadmat.html</a></p>

python matlab h5py hdf5storage