Documentation

Getting Started withMicrosoft.NET

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

The Microsoft®.NET Framework is a component that provides a large body of precoded solutions to common program requirements. You can create instances of .NET classes and interact with .NET applications from MATLAB. MATLAB supports the .NET Framework on the Windows®platform only.

Functions

NET.addAssembly Make .NET assembly visible to MATLAB
NET.isNETSupported Check for supported Microsoft .NET Framework
NET Summary of functions in MATLAB .NET interface
enableNETfromNetworkDrive Enable access to .NET commands from network drive

Classes

NET.Assembly 成员。net的屁股embly
NET.NetException Capture error information for .NET exception

Topics

Access a Simple .NET Class

This example shows how to access .NET functionality already installed on your system.

Load a Global .NET Assembly

This example shows you how to make .NET classes visible to MATLAB.

Work with Microsoft Excel Spreadsheets Using .NET

The example uses theMicrosoft.Office.Interop.Excel.ApplicationClassclass to create a spreadsheet, copy MATLAB data to it, and then close it.

Work with Microsoft Word Documents Using .NET

The example uses theMicrosoft.Office.Interop.Word.ApplicationClassclass to create a Word document.

Build a .NET Application for MATLAB Examples

Basic information for building the .NET examples included with MATLAB.

Simplify .NET Class Names

Use the MATLABimportfunction to refer to .NET class names.

Use import in MATLAB Functions

Guidelines for using theNET.addAssemblyandimportfunctions.

Nested Classes

Using reflection to instantiate a nested class.

Handle .NET Exceptions

MATLAB catches exceptions thrown by .NET and converts them into aNET.NetExceptionobject.

Assembly is Library of .NET Classes

Anassemblyis a collection of types and resources built to work together and form a logical unit of functionality in .NET Framework applications.

System Requirements for Using MATLAB Interface to .NET

Using a supported version of the .NET Framework.

Using .NET from MATLAB

How you can benefit from using .NET from MATLAB.

Using a .NET Object

How to create a .NET object.

.NET Terminology

Understanding namespaces and reference and value types.

Troubleshooting

从Netw故障诊断安全策略设置ork Drives

For MATLAB releases R2012b or earlier, call theenableNETfromNetworkDrivefunction to create a MATLAB security policy entry.

Limitations to .NET Support

.NET features not supported in MATLAB.

Limitations to Support of .NET Arrays

MATLAB does not support:

Limitations to Support of .NET Methods

Themethodsandmethodsviewfunctions do not list generic methods.

Limitations to Support of .NET Events

An event handler in C# is a delegate with the following signature:

Limitations to Support of .NET Delegates

MATLAB does not support associating a delegate instance with a generic .NET method.

Limitations to Support of .NET Enumerations

You cannot create arrays of .NET enumerations, or any .NET objects, in MATLAB.

Was this topic helpful?