Main Content

engClose (C)

Quit MATLAB engine session

C Syntax

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

Description

Send a quit command to the MATLAB® engine session and close the connection. The function returns 0 on success and 1 on failure. Possible failure includes attempting to terminate an already-terminated MATLAB engine session.

Note

matlab::engine::terminateEngineClient in the MATLAB Engine API for C++ is recommended over engClose. 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 engClose or the Engine API for C.

Input Arguments

expand all

Pointer to engine, specified as Engine *.

Examples

Close MATLAB Engine from C on Windows

This C code shows how to close a MATLAB engine from a C program on a Windows® system.

 engwindemo.c

Close MATLAB Engine from C on Linux or macOS

This C code shows how to close a MATLAB engine from a C program on a Linux® or macOS system.

 engdemo.c

Version History

Introduced before R2006a