[SciPy-dev] io.loadmat

Nils Wagner nwagner at mecha.uni-stuttgart.de
Tue Oct 14 04:28:28 CDT 2003


Dear experts,

I need some advice concerning loadmat

loadmat -- read a MATLAB (version <= 4) style mat file

loadmat(name, dict=None, appendmat=1)
    Load the MATLAB mat file saved in level 1.0 format.

    If name is a full path name load it in.  Otherwise search for the
file
    on the sys.path list and load the first one found (the current
directory
    is searched first).

    Only Level 1.0 MAT files are supported so far.

    Inputs:

      name -- name of the mat file (don't need .mat extension)
      dict -- the dictionary to insert into.  If none the variables will
be
              returned in a dictionary.
      appendmat -- non-zero to append the .mat extension to the end of
the
                   given filename.

    Outputs:

      If dict is None, then a dictionary of names and objects
representing the
      stored arrays is returned.

What is meaning of level 1.0 format ?

Afaik, the current version of Matlab is 6.5. However loadmat seems to be
restricted
to version <=4. Is there any progress in upgrading this feature ?


from scipy import *
file=open("matrizen_red.mat",'r')
io.loadmat(file,appendmat=0)

raceback (most recent call last):
  File "matlab.py", line 3, in ?
    io.loadmat(file,appendmat=0)
  File "/usr/local/lib/python2.1/site-packages/scipy/io/mio.py", line
348, in loadmat
    if os.sep in name:
TypeError: 'in' or 'not in' needs sequence right argument

Any suggestion ?

Nils


More information about the Scipy-dev mailing list