Main Content

Get Started with Microsoft .NET

R2026b
Examples and concepts to help you quickly get started using .NET in MATLAB®

The MATLAB interface to .NET lets you bring .NET assemblies into the MATLAB environment to construct objects from classes contained in the assemblies, and to call methods on these objects.

MATLAB supports loading these .NET assemblies:

  • .NET, including .NET Core (Microsoft® Windows®, macOS, and Linux®)

  • .NET Framework (Windows 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.

To determine if your system has a supported version, use the NET.isNETSupported function.

Functions

NET.addAssemblyMake .NET assembly visible to MATLAB
NET.unloadAssemblyUnload .NET Core assembly from MATLAB (Since R2026a)
NET.isNETSupportedCheck for supported version of Microsoft .NET
NET.interfaceViewExplicit interface view of .NET object (Since R2023b)

Classes

NET.AssemblyMembers of .NET assembly

Objects

NET.NetExceptionCapture error information for .NET exception

Namespaces

NETSummary of functions and classes in MATLAB .NET interface

Topics

Troubleshooting

Resolve Error Using .NET Base Class: Undefined Function or Variable

Troubleshoot Undefined Function or Variable error with .NET classes.

Troubleshooting Security Policy Settings from Network Drives

For MATLAB releases R2012b or earlier, call the enableNETfromNetworkDrive function to create a MATLAB security policy entry.

Limitations to .NET Support

.NET features not supported in MATLAB.