Call MATLAB from .NET
MATLAB Engine API for .NET provides an interface between .NET programming languages and MATLAB. This API enables programs to launch MATLAB, evaluate MATLAB functions with arguments, and exchange data between MATLAB and .NET programs.
To access .NET libraries directly from MATLAB instead, see Call .NET from MATLAB.
If you need to maintain existing .NET programs created for MATLAB R2022a or earlier that work with the Microsoft® Component Object Model (COM), see Write COM Applications to Work with MATLAB.
|Convert running MATLAB session to shared session|
|Return name of shared MATLAB session|
|Determine if MATLAB session is shared|
|Generate C# code interface for MATLAB packages, classes, and functions (Since R2023b)|
MATLAB Engine for .NET
MATLAB Data API for .NET
|.NET class to represent pointers to MATLAB arrays (Since R2022b)|
|.NET class to represent scalar instances of MATLAB classes (Since R2022b)|
|.NET class to represent scalar MATLAB structures (Since R2023a)|
|.NET class to manage interactions with MATLAB base workspace variables (Since R2022b)|
|.NET class to specify options for MATLAB function evaluation (Since R2022b)|
|.NET base class for invoking MATLAB functions (Since R2023b)|
Set Up and Build Engine Applications
Start MATLAB from .NET Application
- Start MATLAB Session from .NET
Start a .NET engine session synchronously or asynchronously, and pass startup options to MATLAB.
- Connect .NET Application to Running MATLAB Session
Connect the .NET engine to a running MATLAB session that has been started as or converted to a shared session.
- Pass .NET Data Types to MATLAB Functions
Convert .NET data to MATLAB data.
- Handle MATLAB Data in .NET Applications
Convert MATLAB data to .NET data.
- Strongly Typed Interface for C#
A strongly typed interface enforces a strict data type mapping between MATLAB and C# to use in .NET applications.
MathWorks.MATLAB.Exceptions namespace contains the
exception classes for the .NET engine.