user192936
user192936

Reputation:

Skip code part in MEX compilation

I have a C file that is compiled for both a console application and a MATLAB MEX file. I wish to exclude some parts of the code when compiled for MEX. Is there a definition I can check during MEX compilation?

Upvotes: 1

Views: 91

Answers (1)

Praetorian
Praetorian

Reputation: 109219

Mex files are required to have the preprocessor symbol MATLAB_MEX_FILE defined.

Upvotes: 1

Related Questions