MEX Version Compatibility
For best results, your version of MATLAB® must be the same version that was used to create the MEX file.
MEX files use MATLAB run-time libraries. A MEX file that was created on an earlier version of MATLAB usually runs on later versions of MATLAB. If the MEX file generates errors, recompile the MEX file from the source code.
Sometimes a MEX file created on a newer version of MATLAB runs on an older version of MATLAB, but this is not supported.