C++ .MAT file format

5 visualizaciones (últimos 30 días)
Nycholas Maia
Nycholas Maia el 2 de Feb. de 2020
Comentada: Nycholas Maia el 4 de Feb. de 2020
I have a C++ application that generates a lot of numerical matrices and vectors using C++ numerical libraries as Eigen and Blaze (and std::vector too)
I would like to store these results in a file that could be opened in MATLAB.
I saw that MATLAB have a C/C++ API that enable developers store numbers/strings in the *.mat file format.
But in this MATLAB API my C++ matrices and vectors should be mxArray pointer.
How can I use this MATLAB API to store my Eigen and Blaze matrices?
  2 comentarios
James Tursa
James Tursa el 3 de Feb. de 2020
Can you simply write the matrices out to a binary file and then use fread to get them into MATLAB?
Nycholas Maia
Nycholas Maia el 4 de Feb. de 2020
Hi @James Tursa,
Yes, I can do that, but my application will generate a lot os matrices and vectors as results.
I would like to retrive each one by a "name" or "id"...
Like "rotation_matrix", "time_vector"...etc...
And another thing:
I would like to get a specific matrix in this file without need to load all file data.
The HDF5 file format can do that and MATLAB have support to it, but I would like to know if there is a good and stable C++ API to help me.
Or if there is another file format that I can obtain these 2 features:
  • Get matrix by name or path
  • No need to load all file data to get some matrix

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Call C++ from MATLAB en Help Center y File Exchange.

Productos


Versión

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by