Registered Member
|
I'm hoping to easily read/write data files in matlab's .mat file format. Does anyone know of a simple means to do so?
I don't need any particularly complex matlab features; the ability to load a .mat file and extract/write the value of a few stored matrices would be sufficient. Since I'm using eigen for most of my matrix needs, clean interop with eigen would be a boon - but really, anything that makes writing/reading floating point matrices to/from a .mat file would work for me. I'm hoping others have needed to do this before and done all the hard work for me, naturally . Anyone have any tips? |
Registered Member
|
Hi,
I am not sure this is a good forum to post on propriatery software such as Matlab. Anyway if you mean do read and write .mat files Without the matlab software, octave should do the job. |
Registered Member
|
Not sure if it would helps, but after a quick search, I found yacc/lex files for the Matlab grammar on this page, so if you end up writing a parser, it might help.
Get problems solved faster - get reply notifications through Jabber!
|
Registered Member
|
Hi,
given you have Matlab installed you are probably looking for the commands
Those are all defined in "mat.h". To create an mxArray the following code should work (I think it requires "matrix.h")
Finally you need to cleanup your data with mxDestroyArray. I am leaving the conversion from mxArray to Eigen matrices up to you and the fine tuning for the proper Scalar support too... Cheers, Hauke |
Registered users: Bing [Bot], daret, Google [Bot], sandyvee, Sogou [Bot]