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 件のコメント

James Tursa
James Tursa 2020 年 2 月 3 日
Can you simply write the matrices out to a binary file and then use fread to get them into MATLAB?
Nycholas Maia
Nycholas Maia 2020 年 2 月 4 日
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

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCall C++ from MATLAB についてさらに検索

製品

リリース

R2019b

質問済み:

2020 年 2 月 2 日

コメント済み:

2020 年 2 月 4 日

Community Treasure Hunt

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

Start Hunting!

Translated by