Is it possible to keep Matlab objects as mxArray type in C++ application ?

Hi,
i am planning on writing an application in C++ and i want to use certain Matlab functions as a .dll that can be compiled with the mcc. Further more i want to make use of objects implemented in Matlab, that i want to pass from one Matlab dll function to another. But therefore i need to store it in an mxArray, or something that the calling application can handle. Is that possible and how would it be done ? So more general, how can Matlab objects be used in C++ ? Sorry if the question is not very detailed, but i am at a very early stage, and just want to check out the possibilities. Any hint will be greatly appreciated. Thanks in advance, ...

 Respuesta aceptada

James Tursa
James Tursa el 18 de Feb. de 2016
Editada: James Tursa el 18 de Feb. de 2016
How do you plan on calling the MATLAB functions? With the Engine API interface? If so, then as long as you build the application properly with the API library links you should be able to create & store mxArray objects for your eventual MATLAB function calls via the Engine. E.g., see this link:
Note, however, that using a MATLAB Engine will cause deep copies of the mxArray variables whenever you pass arguments to the Engine and retrieve the results.

1 comentario

Hi, and thanks for the answer. Just to clarify: It is possible to store more complex MATLAB objects (with methods and stuff) in a simple mxArray ?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre C Shared Library Integration en Centro de ayuda y File Exchange.

Productos

Etiquetas

Preguntada:

el 18 de Feb. de 2016

Comentada:

el 22 de Feb. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by