Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

Fortran Source 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 information about writing C/C++ MEX files, see C/C++ Source Files.

For information about using the loadlibrary and calllib commands to call functions in shared libraries, see Call C Shared Libraries.

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.

Was this topic helpful?