Integrate MATLAB with External Programming Languages and Systems - MATLAB & Simulink (original) (raw)

MATLAB® provides a flexible, two-way integration with other programming languages, allowing you to reuse legacy code. For a list of programming languages and the supported versions, see MATLAB Supported Interfaces to Other Languages.

Call C/C++ Code from MATLAB

MATLAB provides these features to help you integrate C/C++ algorithms into your MATLAB applications.

These features require C/C++ programming skills to create a library interface or to write a MEX function. However, you can give the resulting library or MEX function to any MATLAB user. The end user calls the functionality like any MATLAB function, without knowing the underlying details of the C/C++ language implementation.

To call MATLAB from a C/C++ language program, see Call MATLAB from C++ or Call MATLAB from C.

Use Objects from Other Programming Languages in MATLAB

If you have functions and objects in another programming language, you can call them from MATLAB. You do not need to be a software developer to integrate these objects into your MATLAB application. However, you need access to third-party documentation for the libraries.

MATLAB supports calling functions and using objects in the following languages.

Call MATLAB from Another Programming Language

You can call MATLAB from another language using Engine Applications. Using MATLAB engine APIs, call MATLAB functions from your own application. MATLAB has APIs for the following languages.

To create an engine application, install a compiler that MATLAB supports and use the mex command to build the application.

Call Your Functions as MATLAB Functions

You can write your own functions and call them as MATLAB functions using MEX APIs. For more information, see Choosing MEX Applications. You can write MEX functions in the following languages.

To create a MEX file, install a compiler that MATLAB supports and use the mex command to build the function.

Communicate with Web Services

You can communicate with web services from MATLAB.

See Also

Topics