A MEX-file is a function, created in MATLAB, that calls a C, C++, or Fortran subroutine. To call a MEX-file, use the name of the file, without the file extension. The MEX-file contains only one function or subroutine, and its name is the MEX-file name. The file must be on your MATLAB path.
For information about creating MEX-files, see MEX-File Creation API.