Creating user defined class objects inside mexfunction

5 次查看(过去 30 天)
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 个评论
AJ
AJ 2015-1-8
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

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Write C++ Functions Callable from MATLAB (MEX Files) 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by