Creating user defined class objects inside mexfunction
5 views (last 30 days)
Show older comments
Hello
I need a mexfunction that can output an object of a user defined Matlab class. The object should be created inside the mexfunction and returned as lhs mxArray.
myObject = myMexFunction(a,b,c);
I'm looking for a way to create a class object inside a mexfunction, say, through Matrix C/C++ APIs. Is it possible? If not through APIs, are there other ways of doing it?
I'm using 2014a version.
I appreciate any help on this question.
Thank you
Satheesh
1 Comment
AJ
on 8 Jan 2015
I too have a need to manipulate class objects inside a hand-coded mex function. I do know that old-style Matlab class definitions (using directory names beginning with '@') can be used in mex functions to access the data items, treating them like structures.
I have a particular interest in Matlab enumerations within mex files. These objects are sufficiently obfuscated to baffle my programming prowess. It seems to me that the mex API functions have not been keeping up with Matlab language development. I've been writing mex functions for nearly 20 years, and would love to see some additional mex API functions that deal with class objects (and also with function handles).
FWIW,
AJ
Answers (0)
See Also
Categories
Find more on Write C++ Functions Callable from MATLAB (MEX Files) in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!