Microsoft .NET 快速入门
.NET 接口允许您将 .NET 程序集引入 MATLAB 环境中,从这些程序集中包含的类来构造对象,以及对这些对象调用方法。
MATLAB 仅在 Microsoft® Windows® 平台上支持加载为 .NET(包括 .NET Core 以及 Microsoft .NET Framework)编译的库。有关详细信息,请参阅System Requirements for Using MATLAB Interface to .NET。有关与 MATLAB 兼容的 .NET 版本的信息,请参阅其他语言的 MATLAB 接口。
要确定您的系统是否具有支持的版本,请使用 NET.isNETSupported
函数。
函数
NET.addAssembly | 将 .NET 程序集添加至 MATLAB |
NET.isNETSupported | 检查支持的 Microsoft .NET 版本 |
NET.interfaceView | Explicit interface view of .NET object (自 R2023b 起) |
NET | MATLAB .NET 接口函数摘要 |
enableNETfromNetworkDrive | (将删除)支持从网络驱动器访问 .NET 命令 |
类
NET.Assembly | .NET 程序集成员 |
对象
NET.NetException | 捕获 .NET 异常的错误信息 |
主题
- System Requirements for Using MATLAB Interface to .NET
Using a supported version of .NET.
- Access a Simple .NET Class
This example shows how to access .NET functionality already installed on your system.
- Work with Microsoft Excel Spreadsheets Using .NET
This example for Microsoft .NET Framework uses the
Microsoft.Office.Interop.Excel.ApplicationClass
class to create a spreadsheet, copy MATLAB data to it, and then close it. - Work with Microsoft Word Documents Using .NET
This example for Microsoft .NET Framework uses the
Microsoft.Office.Interop.Word.ApplicationClass
class 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 MATLAB
import
function to refer to .NET class names. - 在 MATLAB 函数中使用 import
NET.addAssembly
和import
函数的使用规范。 - Use .NET Nested Classes
Using reflection to instantiate a nested class.
- Handle .NET Exceptions
MATLAB catches exceptions thrown by .NET and converts them into a
NET.NetException
object. - Assembly Is a Library of .NET Classes
An assembly is a collection of types and resources built to work together and form a logical unit of functionality in .NET applications.
- 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 Security Policy Settings from Network Drives
For MATLAB releases R2012b or earlier, call the
enableNETfromNetworkDrive
function to create a
MATLAB security policy entry.
.NET features not supported in MATLAB.
Limitations to Support of .NET Arrays
.NET features not supported in MATLAB.
Limitations to Support of .NET Methods
.NET features not supported in MATLAB.
Limitations to Support of .NET Events
.NET features not supported in MATLAB.
Limitations to Support of .NET Delegates
.NET features not supported in MATLAB.
Limitations to Support of .NET Enumerations
.NET features not supported in MATLAB.