importing matlab files (.mat) into sage?

221 views
Skip to first unread message

Stan Schymanski

unread,
Nov 2, 2011, 6:02:46 AM11/2/11
to sage-devel
Dear all,

While looking for a way to import a matlab file into sage, I stumbled
over scipy.io.loadmat and found a ticket where this is implemented
into sage along with some other useful input/output routines:
http://trac.sagemath.org/sage_trac/ticket/7317

Does anyone have an opinion whether this could be reviewed and merged
at any point?

Cheers
Stan

Thierry Dumont

unread,
Nov 2, 2011, 6:25:27 AM11/2/11
to sage-...@googlegroups.com
Le 02/11/2011 11:02, Stan Schymanski a �crit :
Try this:

import scipy.io
X = scipy.io.loadmat('mydata.mat')

yours
t.d.

tdumont.vcf

Simon King

unread,
Nov 2, 2011, 7:39:25 AM11/2/11
to sage-devel
Hi Stan,
That ticket certainly needs work. First of all, it does not provide a
patch, but only a .py file. Then, it is not clear to me whether the
conversion routines should be put into the global name space, or
whether there is a nice syntax to use them.

For example, I think it would be nice if Sage could auto-detect the
format of a data file. That's to say, if "mydata.mat" provides
something that is stored in matlab format, then it would be nice if X
= load("mydata.mat") just worked (by dispatching to scipy.io, for
example). The attachment of #7317 doesn't provide this.

Best regards,
Simon

Stan Schymanski

unread,
Nov 2, 2011, 12:27:33 PM11/2/11
to sage-devel
Hi Simon and Thierry,

Thanks for your comments. Yes, I thought that the ticket would need
some more work and I guess the incentive is not so high as long as
there are quite comfortable ways to do these things by hand as pointed
out by Thierry. I just thought that this might be a good one for a
student project or so...

Cheers
Stan
Reply all
Reply to author
Forward
0 new messages