Main Content

matlab.mex.MexHost class

Package: matlab.mex
Superclasses: handle

Out-of-process host for C++ MEX function execution

Description

Instances of the matlab.mex.MexHost class represent processes created to execute C++ MEX functions. You can execute a C++ MEX function from MATLAB® in the host process using the feval method of this class. For information on running C++ MEX functions out of process, see Out-of-Process Execution of C++ MEX Functions.

The matlab.mex.MexHost class is a handle class.

Creation

Use the mexhost function to create a matlab.mex.MexHost object.

Properties

expand all

Process environment variables, returned as a string array.

Attributes:

GetAccess
public
SetAccess
private

Data Types: string

Names of the C++ MEX functions loaded in the host process, returned as a string vector.

Attributes:

GetAccess
public
SetAccess
private

Data Types: string

Name of the C++ MEX host process, returned as a string scalar.

Example: MATLABMexHost

Attributes:

GetAccess
public
SetAccess
private

Data Types: string

Process identifier of the C++ MEX host process, returned as a string scalar.

Attributes:

GetAccess
public
SetAccess
private

Data Types: string

Methods

expand all

Examples

collapse all

Create an object of the matlab.mex.MexHost class using the mexhost function. Use the object to call the feval, which executes your C++ MEX function in the MEX host process.

mexHost = mexhost;
result = feval(mexHost,'MyMexFunction',inputs);
Introduced in R2019a