Matlab import

Tony C cappy2112 at gmail.com
Thu Oct 7 18:04:01 EDT 2004


alberto.mantovaniNOSPAM at bologna.marelli.it (Alberto) wrote in message news:<4164fec6.5798796 at news.marelli.it>...
> 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 ?
> 
> thanks 
> Alberto

I did this about a year ago- so I hope it still works.

1 You need the SciPy package installed.
Google for scipy- I'm sure you will find it.

2. from scipy import io
(you can import everything if you want, but the scipy package is
almost as massive as the python distribution :-) )

3.  myobject = io.loadmat(matlab_filename, None, 0)

I think myobject is a typical matlab matrix.
If you use PythonWin, you can do commandline completion on the
myobject
object, to look for attributes.

I dont use matlab, so I can't help you much further.

good luck


Tony



More information about the Python-list mailing list