how to use matlab garch function in C++ (using the C/C++ compiler)

3 ビュー (過去 30 日間)
Isma
Isma 2015 年 3 月 20 日
コメント済み: Isma 2015 年 3 月 20 日
Hi
Is there somehow a way of using matlab garch functions in my c++ project so as to get parameter estimates without resorting to dlls (i.e @export functions...)?
Actually I am only keen on solutions working with the C/C++ compiler, that enable me to debug easily my codes.
ps: any answer provided with some documentation in regards to implementation (links, etc.) will be very appreciated
Best,

採用された回答

James Tursa
James Tursa 2015 年 3 月 20 日
編集済み: James Tursa 2015 年 3 月 20 日
The general advice here is
1) Have MATLAB call your C++ code as a mex routine, and then use the mexCallMATLAB function inside your C++ code to call back to MATLAB for the functions you want. This is the easiest way to call MATLAB functions and get the results back into your C++ code. Your C++ code is actually a DLL for MATLAB and shares the same address space as MATLAB. The downside is you may need to re-architecture some of your code (e.g., I/O) to get it to work as a mex function, and it can be a little more difficult to debug your C++ code, but can be done.
2) Have your C++ code call MATLAB as an Engine application. MATLAB actually starts as a separate process (does not share the same address space with your C++ code) so variables have to be copied back & forth to get the function calls done. So fewer changes will be needed for your C++ code to go this route, but more cumbersome and generally less efficient than the mex function route for the MATLAB function calling part, and probably easier to debug your C++ code.
Information and examples can be found here:
  3 件のコメント
James Tursa
James Tursa 2015 年 3 月 20 日
Take a look at this FEX submission to see if it has what you want. It provides example Engine code for making a MATLAB function call from C/C++ and getting the result back into the C/C++ code.
Isma
Isma 2015 年 3 月 20 日
cheers.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConditional Variance Models についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by