I'm writing a Qt C++ app that requires mat file access but I don't have or plan to buy any Mathlab licences, so is really nice to find this tool library. Before this I was loading the files with octave and translating them to CVS in order to load them on my app. With this library my app can stand alone, no need for external conversion tools. Thanks a lot!
I have been reading the documentation of the current Debian wheezy package and have figured out how to open a file and navigate trough it's variables, see the kind of var, it's dimensions, etc. But I can't figure out how to access a matrix elements.
Can someone please provide some examples on how to access matrix elements for reading and writing?
It would be nice too to put some full examples on the manual on how to create and read the different kinds of variables.
Thanks in advance for any help you can bring me.
And, once again, thanks for this useful library.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You can access the matrix elements with the "data" field of the matvar_t structure. If you don't have the sources, I would recommend downloading them (either from Git or the recent snapshot made). There is a test_mat.c source file that has many of different examples of reading and writing. You can also look at the Mat_VarPrint function in src/mat.c. I understand the manual is a bit lacking. I started a "user guide" but never really got far, but I agree some examples in the guides would be nice. Feel free to contribute to the documentation.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi there!
I'm writing a Qt C++ app that requires mat file access but I don't have or plan to buy any Mathlab licences, so is really nice to find this tool library. Before this I was loading the files with octave and translating them to CVS in order to load them on my app. With this library my app can stand alone, no need for external conversion tools. Thanks a lot!
I have been reading the documentation of the current Debian wheezy package and have figured out how to open a file and navigate trough it's variables, see the kind of var, it's dimensions, etc. But I can't figure out how to access a matrix elements.
Can someone please provide some examples on how to access matrix elements for reading and writing?
It would be nice too to put some full examples on the manual on how to create and read the different kinds of variables.
Thanks in advance for any help you can bring me.
And, once again, thanks for this useful library.
You can access the matrix elements with the "data" field of the matvar_t structure. If you don't have the sources, I would recommend downloading them (either from Git or the recent snapshot made). There is a test_mat.c source file that has many of different examples of reading and writing. You can also look at the Mat_VarPrint function in src/mat.c. I understand the manual is a bit lacking. I started a "user guide" but never really got far, but I agree some examples in the guides would be nice. Feel free to contribute to the documentation.