[SciPy-dev] Saving in MATLAB Level 5 MAT-File Format

Matthew Brett matthew.brett@gmail....
Wed Oct 10 10:42:58 CDT 2007


Excellent - thank you.  I will have a look and put it into mio soon,

Matthew

On 10/10/07, Lars Voxen Hansen <lars@voxdahl.com> wrote:
> I need to save in Matlab Level 5 MAT-File Format. The reson is that
> level 4 only support matrices (2d arrays), I also need to save some
> 3d arrays and load them into matlab.
>
> I have modified mio5.py in ./scipy/io such that this is posible now
> (see example below). The modified file mio5.py is attached to this
> mail. I have tested this on windows XP and mac OS X, where it works
> for me.
>
> Is it posible that this modification can be included in scipy?
>
> Best Regards and thanks for developing scipy
> Lars Voxen Hansen
>
>
> example:
> ----------------
>
> import numpy as N
> from scipy import io
>
> A = N.ones((10,20,30))
> f = open('test.mat','wb')
> MW = io.mio5.MatFile5Writer(f,do_compression=True,unicode_strings=True)
> MW.put_variables({'A1':A,'A2':A+1j*A,'s1':'string1','s2':u'string2'})
> f.close()
>
> d = io.load('test.mat','rb')
>
> ------------------
>
>
>
> _______________________________________________
> Scipy-dev mailing list
> Scipy-dev@scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-dev
>
>
>


More information about the Scipy-dev mailing list