Matlab import

Fernando Perez fperez528 at yahoo.com
Thu Oct 7 12:35:22 EDT 2004


Alberto wrote:

> Dear all,
> often I recived data in matlab format (.mat) I'd like to process these
> data in python environment. Are there some libreries to import .mat
> format in python ?

In [2]: scipy.io.loadmat?
Type:           function
Base Class:     <type 'function'>
String Form:    <function loadmat at 0x2a4b3f7c>
Namespace:      Interactive
File:           /home/fperez/misc/scipy/io/mio.py
Definition:     scipy.io.loadmat(name, dict=None, appendmat=1, basename='raw')
Docstring:
    Load the MATLAB(tm) mat file.

    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).

    Both v4 (Level 1.0) and v5 matfiles are supported.

    Inputs:

      name -- name of the mat file (don't need .mat extension if appendmat=1)
      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.
      basename -- for MATLAB(tm) v5 matfiles raw data will have this basename.

    Outputs:

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


Cheers,

f




More information about the Python-list mailing list