matlab c++ data arrays to c++

how i can transfer arrays that i save from matlab to call it and use it in c++ code

3 件のコメント

Jan
Jan 2022 年 2 月 13 日
It depends on what arrays you mean. DOUBLE arrays can be saved in binary files easily. If you are talking of struct arrays, which fields contain handles of graphic objects, the problem is serious.
MOHAMMED ALMANSOUR
MOHAMMED ALMANSOUR 2022 年 2 月 13 日
no its
x = exprnd(1,1,N);
then i save it im .mat file
can i use it in c++
i want this array to get some result in c++ code
Jan
Jan 2022 年 2 月 13 日
You can either write a Mex function to call the C++ routine directly without the indirection over the hard disk. Or you can save the data to a binary file using fopen/fwrite/fclose.

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

回答 (1 件)

Akshat Dalal
Akshat Dalal 2025 年 5 月 12 日

0 投票

Hi Mohammed,
There are a few different ways to achieve this as Jan mentioned. I would also suggest a few other ways:
I hope this helps!

カテゴリ

ヘルプ センター および File ExchangeMATLAB Coder についてさらに検索

質問済み:

2022 年 2 月 13 日

回答済み:

2025 年 5 月 12 日

Community Treasure Hunt

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

Start Hunting!

Translated by