フィルターのクリア

How to generate a DLL file from Matlab for C++ (i'm using 2013a)

8 ビュー (過去 30 日間)
Anushka Ekanayake
Anushka Ekanayake 2015 年 7 月 18 日
編集済み: Ryan Livingston 2015 年 7 月 20 日
I have a matlab code and I want to call that code from my C++ project. As I found it can be done by generating a .dll file from matlab code. Can you guide me how can I generate a .dll file which can be accessed from C++ code. All your suggestions are highly appreciated. If there are other ways of accessing matlab code from C++ tell them also.

回答 (1 件)

chef13
chef13 2015 年 7 月 18 日
Hi,
For that you could use the MATLAB Coder.
To to what you want you should set the target to C/C++ Dynamic Library in the project. Another thing that you need to remember is that the generated code must also be built so remember to uncheck Generate code only.
After these steps the DLL should appear in the directory codegen/dll/[project].
I hope it works, probably the following code generates a DLL test for the file test.m
coderdemo_setup('coderdemo_test');
codegen -config:dll test
I hope it helps.
  1 件のコメント
Ryan Livingston
Ryan Livingston 2015 年 7 月 20 日
編集済み: Ryan Livingston 2015 年 7 月 20 日
Depending upon your needs you could also consider MATLAB Compiler. For more details, you can refer to this answer that describes MATLAB Coder and MATLAB Compier and tries to outline how to choose which one would be most appropriate.

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

カテゴリ

Help Center および File ExchangeMATLAB Coder についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by