External Interfaces/API    

Calling C and Fortran Programs from MATLAB

Although MATLAB® is a complete, self-contained environment for programming and manipulating data, it is often useful to interact with data and programs external to the MATLAB environment. MATLAB provides an interface to external programs written in the C and Fortran languages.
Introducing MEX-Files
Using MEX-files, mx routines, and mex routines
Data types you can use in MEX-files
Building MEX-Files
Compiling and linking your MEx-file
Custom Building MEX-Files
Platform-specific instructions on custom building
Troubleshooting some of the more common problems you may encounter
Additional Information
Files you should know about, example programs, where to get help

  External Interfaces/API Introducing MEX-Files