[SciPy-user] io.loadmat

Ryan Krauss ryanlists at gmail.com
Tue Jan 31 20:00:05 CST 2006


I am having trouble loading Matlab .mat files that loaded just fine
under the old scipy.  Here is the error message:
In [1]: test=scipy.io.loadmat('figure5')
---------------------------------------------------------------------------
exceptions.TypeError                                 Traceback (most
recent call last)

/home/ryan/thesis/actuator_modeling/<ipython console>

/usr/lib/python2.4/site-packages/scipy/io/mio.py in loadmat(name,
dict, appendmat, basename)
   745     if not (0 in test_vals):       # MATLAB version 5 format
   746         fid.rewind()
--> 747         thisdict = _loadv5(fid,basename)
   748         if dict is not None:
   749             dict.update(thisdict)

/usr/lib/python2.4/site-packages/scipy/io/mio.py in _loadv5(fid, basename)
   682         try:
   683             var = var + 1
--> 684             el, varname = _get_element(fid)
   685             if varname is None:
   686                 varname = '%s_%04d' % (basename,var)

/usr/lib/python2.4/site-packages/scipy/io/mio.py in _get_element(fid)
   642         fid.rewind(1)
   643     # get the data tag
--> 644     raw_tag = fid.read(1,'I')
   645
   646     # check for compressed

/usr/lib/python2.4/site-packages/scipy/io/mio.py in read(self, count,
stype, rtype, bs, c_is_b)
   283         if count == 0:
   284             return zeros(0,rtype)
--> 285         retval = numpyio.fread(self, count, stype, rtype, bs)
   286         if len(retval) == 1:
   287             retval = retval[0]

TypeError: argument 3 must be char, not type

I attached the message in a previous message, but it was sent to a
moderator because it is 600kb.  I thought that was a reasonable
attachment size, but I guess that message limit is 100kb.  If anyone
wants the file to try and help me with this, I will gladly send it off
list or post it on my website.

Thanks,

Ryan



More information about the SciPy-user mailing list