Main Content

Call MATLAB from Fortran

Write Fortran programs that work with MATLAB

Engine applications are standalone programs that allow you to call MATLAB® from your own Fortran programs, using MATLAB as a computation engine. To build an engine application, call the mex function.

Engine applications require an installed version of MATLAB; you cannot run the MATLAB engine on a machine that only has the MATLAB Runtime.

Fortran Engine API Functions

engOpenStart MATLAB engine session
engCloseQuit MATLAB engine session
engEvalStringEvaluate expression in string
engGetVariableCopy variable from MATLAB engine workspace
engPutVariablePut variable into MATLAB engine workspace
engOutputBufferSpecify buffer for MATLAB output