Main Content

Fortran Source MEX Files

Write Fortran subroutines using MATLAB® API libraries

A MEX file lets you call a Fortran subroutine from MATLAB. To create a MEX file, you need:

For examples, see Tables of MEX Function Source Code Examples.

For information about writing S-functions using Fortran code, see your Simulink® documentation.

MEX files are not appropriate for all applications. MATLAB is a high-productivity environment whose specialty is eliminating time-consuming, low-level programming in compiled languages like Fortran. In general, do your programming in MATLAB. Do not use MEX files unless your application requires it.

Topics

Related Information

Go to top of page