How can I pass a C++ Function into MATLAB function when doing mixed programming?

10 views (last 30 days)
Hi friends: Because I need to do some secondary development using NX OPEN/C API, and I would like to take adantage of the math functions in MATLAB,I'm trying to do mixed programming. You know, it's not difficult to pass a number, vector or matrix into a compiled MATLAB function when programming in Visual C++. However, some functions, for example, optimization functions,need another function as their input. That's what the question is. When the MATLAB code was compiled, I found the input of function hundle became MwArray,and it seemed it was not prepared to receive a function. I found a paper saying that we can #include"matlab.hpp" and use MATLAB C++ Math Library. But in fact matlab.hpp is out of date. Is there another way to solve this problem? My software versions are MATLAB 2014a and Visual Studio 2015. Thanks!

Answers (0)

Community Treasure Hunt

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

Start Hunting!