This is machine translation

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

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

engClose (C and Fortran)

Quit MATLAB engine session

C Syntax

#include "engine.h"
int engClose(Engine *ep);

Fortran Syntax

#include "engine.h"
integer*4 engClose(ep)
mwPointer ep



Engine pointer


0 on success, and 1 otherwise. Possible failure includes attempting to terminate an already-terminated MATLAB® engine session.


This routine sends a quit command to the MATLAB engine session and closes the connection.


See these examples in matlabroot/extern/examples/eng_mat:

  • engdemo.c for a C example on UNIX® operating systems.

  • engwindemo.c for a C example on Microsoft® Windows® operating systems.

  • fengdemo.F for a Fortran example.

See Also


Introduced before R2006a