Does the MATLAB engine support creation of function handles?

3 visualizaciones (últimos 30 días)
Sean
Sean el 4 de Dic. de 2024
I am using the MATLAB engine to run MATLAB code from C++. I have some C++ code that I would like to expose to the MATLAB user similar to what is possible when extending Embedded Python (see this link for a description). I am looking for a way to maybe use the ArrayFactory to create a function handle that would execute code in the C++ environment and then pass that function handle into the MATLAB workspace (probably using the setVariable command).
Is this possible? I can't find any documented support for function handles in the MATLAB engine.
It would sure be cool if I could do something like this. It would solve my immediate problem and open the possibility to all kinds of other interesting things in the future.
  2 comentarios
Sumukh
Sumukh el 5 de Dic. de 2024
Hi @Sean,
Based on the description, I understand that you wish to run C++ code written in C++ environment called from MATLAB using function handle so that it can be run in MATLAB. Is this right?
Sean
Sean el 5 de Dic. de 2024
Yeah, that's a good description.

Iniciar sesión para comentar.

Respuestas (1)

MathWorks Supported Compilers Team
MathWorks Supported Compilers Team el 6 de Dic. de 2024
Currently, MATLAB C++ Engine API does not support passing function pointers to MATLAB. However, the development team is aware that this is a desired feature for some customers and are considering it for a future release.

Categorías

Más información sobre Use Prebuilt MATLAB Interface to C++ Library en Help Center y File Exchange.

Productos


Versión

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by