title: Get matlab struct as a numpy array
body: <p>Im trying to load a .mat file in python using:</p>
  <pre><code>Y = scipy.io.loadmat('XYZ.mat')
  </code></pre>
  <p>These are the keys of the dictionary created</p>
  <pre><code>dict_keys(['__header__', '__version__', '__globals__', 'X', 'Y'])
  </code></pre>
  <p><code>type(Y['X'])</code> is</p>
  <pre><code>&lt;class 'scipy.io.matlab.mio5_params.MatlabObject'&gt;
  </code></pre>
  <p>Now, i want the contents of key X as a numpy array.</p>
  <pre><code>Y = np.array(Y['X'])
  </code></pre>
  <p>does not work. When i print Y, this is what i get:</p>
  <pre><code>array([[(array([[[........]]]), array([[  5, 201,  61]], dtype=uint8))]],
    dtype=[('data', 'O'), ('size', 'O')])
  </code></pre>
  <p>How do i access the elements of the array?</p>