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

1 visualizzazione (ultimi 30 giorni)
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, ...

Risposta accettata

James Tursa
James Tursa il 18 Feb 2016
Modificato: James Tursa il 18 Feb 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 Commento
Ulrich
Ulrich il 22 Feb 2016
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 ?

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su C Shared Library Integration in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by