Call C++ class from Matlab
Ältere Kommentare anzeigen
Is it possible to call C++ classes from Matlab? When I use loadlibrary to load a DLL into Matlab, I get the following errors:
Warning: The data type 'error' used by function CLASSNAME does not exist.
> In loadlibrary at 421
Warning: The function 'CLASSNAME' was not found in the library
> In loadlibrary at 421
Would creating a MEX file be any different than using loadlibrary?
Akzeptierte Antwort
Weitere Antworten (2)
Vivek
am 2 Okt. 2019
1 Stimme
We've introduced this capability in MATLAB starting in R2019a. Please take a look:
HANS
am 19 Mär. 2018
0 Stimmen
Hi to all :)
I have name.mex function and many .cpp and .h files related to it. name.mex takes only 1xinf vector which is a complex double values inside and output is the same size vector.
I want to call this name.mex within C++. As I know I have to use "int mexCallMATLAB(int nlhs, mxArray *plhs[], int nrhs, mxArray *prhs[], const char *command_name);"
Please could anybody give a usage example in C++ ? I guess I have to use "ifstream" to load the data vector before I use the function but do I have to define via "mxArray" or ??
Thx, WR
Kategorien
Mehr zu Use Prebuilt MATLAB Interface to C++ Library finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!