Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Fortran MEX Files

Build MATLAB® functions from Fortran subroutines

Call your own Fortran programs from the MATLAB command line as if they were built-in functions. These programs are called MEX files and the function name is the MEX file name.

Write your programs using the MATLAB API libraries — MEX Library and Fortran Matrix Library. The functions in these libraries facilitate the transfer of data between MEX files and the workspace. For more information, see Fortran Source MEX Files. Build the source file into an executable program using the mex function. For more information, see Executable Fortran MEX Files.

To call MATLAB functions from Fortran programs, use the MATLAB API for Fortran engine library functions.

To read and write MATLAB data from C/C++ programs, use the Applications to Read MAT-File Data.

For information about C/C++ programming APIs, see MEX File Applications and MATLAB API for C++.

Was this topic helpful?