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

10 vues (au cours des 30 derniers jours)
jingzhi liu
jingzhi liu le 15 Mar 2017
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!

Réponses (0)

Catégories

En savoir plus sur Call C++ from MATLAB dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by