Using a .mexw64 in a mexFunction

1 view (last 30 days)
Jane Jean
Jane Jean on 15 Apr 2012
Hello,
I've compiled a mexFunction function1.mexw64 and it works perfectly. Now I need this function in another mexFunction of which the compiled version would be function2.mexw64. Is it possible to call a compiled mexFunction in the body of another mexFunction? If yes, how do I do so?
Thanks.

Accepted Answer

Jan
Jan on 15 Apr 2012
Either insert the C-source of function1.c without the mexFunction gateway to function2.c. Or call function2 through mexCallMATLAB:
mxArray *Input[1];
Input[1] = mxCreate...
mexCallMATLAB(0,NULL,1, Input, "function2");
The later is less efficient due to the double overhead of calling Matlab to call the mex.

More Answers (0)

Categories

Find more on Write C Functions Callable from MATLAB (MEX Files) in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!