Re: [eigen] HELP : matlab data import

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


Hi,

you can try Andrea Arteagas library matfile from
  https://bitbucket.org/spiros/matfile/wiki/Home

I don't know if the current version is stable. If not I can upload the
version that I'm already using for some time.

Loading matrices with that is easy-peasy (an excerpt from my code):

void loadMatlabMatrix(const string &strFilename, const string &strVar,
MATSPARSE &loadedMatrix)
{
    InputDevice myFile(strFilename);
    EigenSparseIWrapper<std::complex<double> > wrapperSparse(loadedMatrix);
    myFile.readArray(strVar, wrapperSparse);
    wrapperSparse.get_matrix();
}


void loadMatlabRHS(const string &strFilename, const string &strVar,
MATDENSE &loadedRHS)
{
    InputDevice myFile(strFilename);
    EigenDenseIWrapper<std::complex<double> > wrapperDense(loadedRHS);
    myFile.readArray(strVar, wrapperDense);
    wrapperDense.get_matrix();
}


Sebastian


Am 27.06.2012 12:02, schrieb Gaurav Gupta:
> Hello,
> 
> How can I import data from matlab ".mat" file. My data is complex valued
> matrices.
> Thanks
> 
> Gaurav
> 

Attachment: signature.asc
Description: OpenPGP digital signature



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