Re: [eigen] HELP : matlab data import

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Errata: Matlab stores its data in ColumMajor mode, not RowMajor.

------------------------------------------
Carlos



On Wed, Jun 27, 2012 at 12:06 PM, Carlos Becker <carlosbecker@xxxxxxxxx> wrote:
Hi. It may be easier to write a mex file instead, and call that mex file from matlab. This is what I usually do with my code.

You can map the data from a matlab matrix (real or complex) with Eigen::Map<>. As far as I remember, Matlab buffers are already aligned,
so you can use Eigen::Aligned and RowMajor as well.

From there you can do whatever you want with Eigen, and return results to  matlab. 

If you still want to import a mat file from C++ then that is not an Eigen-specific topic, you may have to find a library that can deal with .mat file importing,
or write your own.

Cheers.

------------------------------------------
Carlos



On Wed, Jun 27, 2012 at 12:02 PM, Gaurav Gupta <gaurav71531@xxxxxxxxx> wrote:
Hello, 

How can I import data from matlab ".mat" file. My data is complex valued matrices.
Thanks

Gaurav




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/