run a c++ function from matlab 2010b

I currently have matlab 2010b. To analyze my dataset vector I would like to pass the vector into a c++ library of functions for analysis, and then have the resulting vector returned. I know that matlab2012 comes with the coder commands for doing something similar, however, if I am using matlab2010b, how can this be done?
Ideally I would want this: 1) write a vector in matlab 2) send vector as a parameter into a c++ function 3) have the c++ function return my answer back to Matlab.
Thanks.

답변 (2개)

Walter Roberson
Walter Roberson 2012년 7월 23일

0 개 추천

This turns out not to have anything to do with MATLAB Compiler or MATLAB Coder. Instead, have a look at loadlibrary()
Note that the function directly called must use C datatypes and C linkage conventions, C++'s extern "C" . That function can then call into true C++.
Kaustubha Govind
Kaustubha Govind 2012년 7월 23일

0 개 추천

How about creating a C++ MEX file so that your C++ function can be used like any other MATLAB function?

카테고리

도움말 센터File Exchange에서 Call C++ from MATLAB에 대해 자세히 알아보기

질문:

2012년 7월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by