Name of MEX class other than MexFunction
1 view (last 30 days)
Show older comments
Am I allowed to use a different name for a MEX class other than MexFunction?
I tried the following and gives me a ton of errors (forward declaration of 'MexFunction')
class test : public matlab::mex::Function{
}
but if I use
class MexFunction : public matlab::mex::Function{
}
works fine
0 Comments
Answers (2)
Pankhuri Kasliwal
on 24 Nov 2020
Hello,
The documentation says that it must be called MexFunction. Please refer to the link given below -
0 Comments
Priysha LNU
on 24 Nov 2020
Hi,
Here is an excerpt from the documentation:
"Define a C++ MEX function as a class named MexFunction that derives from the matlab::mex::Function class. The MexFunction class overrides the virtual operator() of the matlab::mex::Function class."
So, the class named as "MexFunction" should be entry point.
For more details and examples, refer to the following documentation links:
- Structure of C++ MEX function : https://www.mathworks.com/help/matlab/matlab_external/structure-of-c-mex-function.html
- MATLAB Objects in MEX function : https://www.mathworks.com/help/matlab/matlab_external/use-matlab-objects-in-mex-functions.html#mw_c88256bb-8f84-4cc1-8c09-13ea38ef7293
Hope this helps!
DISCLAIMER: These are my own views and in no way depict those of MathWorks.
0 Comments
See Also
Categories
Find more on Write C Functions Callable from MATLAB (MEX Files) in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!