MATLAB: Linking MATLAB and C++

cmatlab enginemex filesmex functions

What's the difference between using the MATLAB engine and MEX Functions in order to link MATLAB and C++?
Thanks!

Best Answer

They work in different directions:
MEX is to call C++ code from the MATLAB environment.
MATLAB Engine is to call MATLAB functionality from the C++ code using the engine API.
Related Question