C++ .MAT file format

7 vues (au cours des 30 derniers jours)
Nycholas Maia
Nycholas Maia le 2 Fév 2020
Commenté : Nycholas Maia le 4 Fév 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 commentaires
James Tursa
James Tursa le 3 Fév 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 le 4 Fév 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

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Call C++ from MATLAB dans Help Center et File Exchange

Produits


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by