Main Content

Engine (C)

Type for MATLAB engine

Description

Engine is a handle to a MATLAB® engine object. Engine is a C language opaque type.

You can call MATLAB as a computational engine by writing C programs that use the MATLAB engine library. Engine is the link between your program and the separate MATLAB engine process.

The header file containing this type is:

#include "engine.h"

Note

matlab::engine::MATLABEngine in the MATLAB Engine API for C++ is recommended over Engine. The MATLAB Engine API for C++ includes modern C++ features for writing engine applications. For more information, see Call MATLAB from C++. There are no plans to remove Engine or the Engine API for C.

Examples

Start MATLAB Engine from C on Windows

This C code shows how to start a MATLAB process on the current host from a C MATLAB function on a Windows® system.

 engwindemo.c

Start MATLAB Engine from C on Linux or macOS

This C code shows how to start a MATLAB process on the current host from a C MATLAB function on a Linux® or macOS system.

 engdemo.c

Call MATLAB Engine Functions from Fortran

This code shows how to call MATLAB engine functions from a Fortran program.

 fengdemo.F