File Exchange

image thumbnail

MATLAB in lightweight platforms

version (7.51 KB) by Christophe Pouillot
How to run MATLAB code in .NET and JAVA framework


Updated 25 Aug 2016

View License
This example shows some examples of custom MATLAB functions that are translated into C DLL code with MATLAB Coder. The generated C code is then used in C# with InterOpServices (.NET service) and in JAVA with JNI. The result is that you can use your custom MATLAB algos on any platform.
This workflow is usefull for platforms (.NET or JAVA) where the Matlab Component Runtime (MCR) cannot be used.
The archive contents:
- custom MATLAB functions (*.m) that manipulate arrays (in and out).
- custom MATLAB script (*.m) that uses codegen to create the C DLL
- a Visual Studio 2010 C# console application (*.sln, *.cs) that uses the C DLL in C# and VB.NET.
- JAVA code that uses the MATLAB function with JNI interface

See files /MATLAB/for_JAVA.m and /MATLAB/for_NET.m that details the commands.

Cite As

Christophe Pouillot (2020). MATLAB in lightweight platforms (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (4)

The folder .NET as specified in the Readme.txt seems to be missing in the ZIP


missing .NET folder

The folder .NET as specified in the Readme.txt seems to be missing in the ZIP
folder with C# and VB.NET code


update description with link to webpage

Update the archive file and the description.

MATLAB Release Compatibility
Created with R2012b
Compatible with any release
Platform Compatibility
Windows macOS Linux