Main Content

Call MATLAB from .NET

Write .NET programs that work with MATLAB®

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.

Fonctions

développer tout

matlab.engine.shareEngineConvert running MATLAB session to shared session
matlab.engine.engineNameReturn name of shared MATLAB session
matlab.engine.isEngineSharedDetermine if MATLAB session is shared
matlab.engine.typedinterface.generateCSharpGenerate C# code interface for MATLAB namespaces, classes, and functions (depuis R2023b)

Classes

développer tout

MathWorks.MATLAB.Engine.MATLABEngine .NET class using MATLAB as a computational engine (depuis R2022b)
MathWorks.MATLAB.Types.MATLABArray.NET class to represent pointers to MATLAB arrays (depuis R2022b)
MathWorks.MATLAB.Types.MATLABObject.NET class to represent scalar instances of MATLAB classes (depuis R2022b)
MathWorks.MATLAB.Types.MATLABStruct.NET class to represent scalar MATLAB structures (depuis R2023a)
MathWorks.MATLAB.Types.MATLABWorkspace.NET class to manage interactions with MATLAB base workspace variables (depuis R2022b)
MathWorks.MATLAB.Types.RunOptions.NET class to specify options for MATLAB function evaluation (depuis R2022b)
MathWorks.MATLAB.Types.MATLABProvider.NET base class for invoking MATLAB functions (depuis R2023b)

Rubriques

Set Up and Build Engine Applications

Start MATLAB from .NET Application

Call MATLAB Functions from .NET

Résolution des problèmes

MathWorks.MATLAB.Exceptions Exception Classes for .NET

The MathWorks.MATLAB.Exceptions namespace contains the exception classes for the .NET engine.

Informations connexes