MWArray API를 사용하여 .NET 애플리케이션에 배포하기
데이터 교환용 MWArray API를 사용하여, 패키징된 MATLAB® 함수를 .NET 애플리케이션에 연동
MATLAB Compiler SDK™를 사용하면, 컴파일된 MATLAB 함수를 .NET 애플리케이션에 연동하려면 MATLAB Runtime을 초기화하는 API, 컴파일된 MATLAB 함수를 MATLAB Runtime으로 불러오는 API, .NET 코드와 MATLAB 사이의 데이터 전달을 관리하는 API를 조합해서 사용해야 합니다.
.NET과 MATLAB 간에 데이터를 마샬링하고 포맷하는 데이터 변환 API는 2가지이며, 그중 하나는 MATLAB 데이터형으로 매핑되는 파생 데이터형을 사용하는 MWArray
이고, 다른 하나는 네이티브 .NET 데이터형을 사용하여 .NET Remoting을 지원하는 네이티브 .NET API입니다. 또한 형식 안전(type-safe) 인터페이스는 네이티브 .NET 데이터형과 직접 작동하는 대체 메서드 세트를 제공합니다.
.NET에서 개발된 서버와 MATLAB 함수를 연동하려면 .NET Remoting API 또는 Microsoft®의 Windows Communications Foundation 프레임워크를 사용하십시오. 이러한 API를 사용하면 분산 애플리케이션을 쉽게 개발하여 웹상에서 활성 Figure를 배포하거나 .NET Remoting 기능에 액세스할 수 있습니다.
함수
compiler.build.dotNETAssembly | Create .NET assembly for deployment outside MATLAB (R2021a 이후) |
compiler.build.DotNETAssemblyOptions | Options for building .NET assemblies (R2021a 이후) |
compiler.build.Results | Compiler build results object (R2020b 이후) |
compiler.package.installer | Create an installer for files generated by MATLAB Compiler (R2020a 이후) |
compiler.package.InstallerOptions | Options for creating MATLAB Compiler package installers (R2020a 이후) |
enableTSUtilsfromNetworkDrive | Set trust setting to load .NET assemblies from network drive |
ntswrap | Generate type-safe API |
클래스
도움말 항목
요구 사항
- MATLAB Compiler SDK .NET Target Requirements
Refer to the software requirements for using MATLAB Compiler SDK to create .NET assemblies. - Setting Up .NET Development Environment
Set up development environment to develop .NET applications containing deployed MATLAB code. - Choosing .NET Deployment Option
Explore .NET deployment options that MATLAB Compiler SDK offers and select the right one for your specific .NET integration needs. - Summary of MATLAB Compiler SDK .NET APIs
Explore the various MATLAB Compiler SDK .NET APIs. - Install and Configure MATLAB Runtime
Install, configure, and uninstall MATLAB Runtime. - 배포를 위한 MATLAB Runtime 경로 설정
MATLAB Compiler™ 또는 MATLAB Compiler SDK로 생성된 애플리케이션을 실행하려는 컴퓨터의 경로를 정의합니다.
.NET 프레임워크를 사용하여 생성 및 연동하기
- Generate .NET Assembly and Build .NET Application
Create a .NET assembly in MATLAB and integrate it with sample C# code. - Package .NET Assemblies from Command Line
Usemcc
at the command line to build an assembly. - Integrate .NET Assembly into F# Application
Use F# to integrate your assembly with less code. - Common Integration Tasks and Naming Conventions
Learn the integration tasks performed by most users.
.NET 6.0을 사용하여 생성 및 연동하기
- Deploy MATLAB Function to Cross-Platform .NET 6.0 Application Using MWArray API
Learn how to package and deploy a MATLAB function to a cross-platform .NET 6.0 application written in C# using the MWArray API.
샘플 애플리케이션
- Create Sample Code to Call Exported Function
Generate sample code in C++, .NET, Java®, or Python® by including sample files during packaging. - Integrate Simple MATLAB Function into .NET Application
Build a .NET application using C# or Visual Basic®. - Integrate Function with Variable Number of Arguments
Build a .NET application using a MATLAB function that takes a variable number of arguments. - Assign Multiple MATLAB Functions in Component Class
Create a .NET assembly containing multiple functions to implement a matrix math program. - Integrate MATLAB Optimization Routines with Objective Functions
Build a .NET assembly that applies optimization routines to objective functions using theMWObjectArray
class. - Use Multiple Classes in .NET Assembly
Create a .NET assembly containing multiple classes to implement a signal analyzer application. - Block Console Display When Creating Figures
Handle interaction in a console-based program that creates MATLAB figures.
데이터 변환
- Data Marshaling with MWArray API
Learn how theMWArray
classes convert data between .NET and MATLAB. - Convert Data Between .NET and MATLAB
See examples on manually converting between native .NET data types and MATLAB types. - Rules for Data Conversion Between .NET and MATLAB
Refer to the rules for converting .NET types to MATLAB types. - Interfaces Generated by MATLAB Compiler SDK
Learn the different class methods generated for each MATLAB function. - Specify Parallel Computing Toolbox Profile in .NET Application
Specify profile information for Parallel Computing Toolbox™ applications. - Limitations on Multiple Assemblies in Single Application
See the data types that cannot be shared across .NET assemblies.
형식 안전 API
- Type-Safe Interfaces
Consider using type-safe interfaces instead ofMWArray
to work directly with native data types. - Implement Type-Safe Interface and Integrate into .NET Application
Create a multiplication program that uses native .NET data types through a type-safe interface. - Create Managed Extensibility Framework Plug-Ins
Extend .NET applications with Managed Extensibility Framework (MEF) plug-ins using a type-safe API.
.NET Remoting
- Create Remotable .NET Assembly
Build a remotable .NET component using the Library Compiler app or programmatically. - Compare MWArray and Native .NET API for Remotable Assemblies
Decide between the
MWArray
and native .NET APIs for data marshaling in an assembly. - .NET Remoting and Windows Communications Foundation
Learn the advantages of implementing remotable .NET components. - Create Windows Communications Foundation Component
Deploy a Windows® Communications Foundation (WCF) component using a type-safe API.
.NET 어셈블리 문제 해결
- Error Handling and Resource Management
Handle errors generated by MATLAB and manage resources explicitly. - Failure to Find MATLAB Runtime Files
View solutions to problems when files cannot be found. - Failure to Find MATLAB Classes
Solutions to problems when classes cannot be found. - Diagnostic Messages
List of diagnostic messages with suggestions about their cause.