Main Content

Selecting .NET Core in MATLAB

Selecting the .NET 6 and higher run-time environment

MATLAB® supports loading libraries compiled for .NET, including .NET Core, and the Microsoft® .NET Framework on the Microsoft Windows® platform only. For details, see System Requirements for Using MATLAB Interface to .NET. For information about .NET versions compatible with MATLAB, see MATLAB Interfaces to Other Languages.

By default, the run-time environment is set to use the Microsoft .NET Framework. To change the environment, use the dotnetenv function. The .NET environment information is persistent across different MATLAB sessions.

To select the .NET Core run-time environment, type:

netDate = System.DateTime.Now; % Load .NET
ne = dotnetenv("core")
ne = 

  NETEnvironment with properties:

            Runtime: core
             Status: loaded
            Version: ".NET 6.0.25"
    RuntimeLocation: "C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.25\"


dotnetenvChange .NET default environment on Microsoft Windows platforms (Since R2022b)


NETEnvironment.NET environment information (Since R2022b)