using #ifdef in c++ generated mexcode
이전 댓글 표시
Hello,
I am calling mexFunction.cpp from matlab
coder.ceval('mexMiFunction', .....);
the mex function in c++ originally looks like this,
void mexMiFunction(int nlhs, mxArray* plhs[],
int nrhs, const mxArray* prhs[])
{
.....
}
but I want to be able to run 2 different codes , depending on if we are generating code using CodeGenerator or not. It would look like this
#ifdef CODER //takes this path if we are using code generator
int miCustomFunction(...)
{
.... different implementation
}
#else
void mexMiFunction(int nlhs, mxArray* plhs[],
int nrhs, const mxArray* prhs[])
{
.....
}
#endif
How can I do it? thanks a lot.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 MATLAB Coder에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!