how connect matlab program with Visual c++ 6.0?

2 ビュー (過去 30 日間)
themar ali
themar ali 2016 年 2 月 4 日
編集済み: Walter Roberson 2016 年 2 月 4 日
i have code in matlab and also code in visual c++ ,i need to know how to return result from c++ to matlab, how to connect between two language ? i have code for search algorithm in c++ 6.0 and need to return result to matlab (R2010b), but i don't know how to return.

回答 (1 件)

Chibuzo Nnonyelu
Chibuzo Nnonyelu 2016 年 2 月 4 日
1. This can be done with MEX. However, you need to have a c++ compiler installed in your system. Your C++ compiler and MATLAB engine must be of the same bit size (32bit or 64bit). Find more on the function in the link below. http://www.mathworks.com/help/matlab/matlab_external/creating-c-mex-files.html
2. To check if MATLAB recognises your C++ compiler, run the following: mex -setup
  1 件のコメント
Guillaume
Guillaume 2016 年 2 月 4 日
I assume that C++ 6.0 actually means the code is written in Visual Studio 6 (there is no version 6 of the C++ standard).
As Chibuzo said, you need to create a mex interface to your C++ code. Visual Studio 6 support from matlab was dropped in 2012, so you should be still good with R2010b.
Seriously, though, it's also time to upgrade. Visual Studio 6 has stopped being supported by Microsoft ages ago and it is a terrible, non-standard compliant, C++ compiler. Similarly matlab 2010b is getting a bit long in the tooth.

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

カテゴリ

Help Center および File ExchangeCall C++ from MATLAB についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by