MATLAB: Is it possible to call an external MEX file from a stand-alone application without including the MEX file during the compilation in MATLAB 7.6 (R2008a)

compilerMATLAB Compilerstand-alone

I have a program that uses a MEX function and I would like to know if it is possible to compile this program without the MEX file and to specify the MEX file for the standalone via the PATH environment variable of the deployment computer.

Best Answer

When a program that depends on MEX file is compiled as a stand-alone, an AUTH file is generated for the MEX file. If the user does not include the MEX file during compilation, this AUTH file will not be generated.
Thus, even if the stand-alone application can locate the MEX file at runtime, it does not have the appropriate AUTH file to execute it. So it is not possible to call an external MEX function from a compiled stand-alone application.