Re: [eigen] HELP : matlab data import

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


I just found this which might be of use, there are examples there of reading and writing a mex file directly
http://www.mathworks.co.uk/help/techdoc/matlab_external/f14500.html
Tom


On 27/06/2012 11:06, Carlos Becker 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/