MATLAB의 .NET 제네릭 클래스
제네릭 클래스는 C# 프로그래밍 언어의 특징입니다. 다음 항목에서는 MATLAB에서 제네릭 클래스를 사용하는 방법을 보여줍니다.
함수
NET.createGeneric | Create instance of specialized .NET generic type |
NET.invokeGenericMethod | Invoke generic method of object |
NET.convertArray | (Not recommended) Convert numeric MATLAB array to .NET array |
클래스
NET.GenericClass | Represent parameterized generic type definitions |
도움말 항목
- Create .NET Collections
This example uses two
System.String
arrays,d1
andd2
, to create a generic collection list. - Convert .NET Collections to MATLAB Arrays
Use the
ToArray
method of theSystem.Collections.Generic.List
class to convert a collection to an array. - Create .NET Arrays of Generic Type
This example creates a .NET array of
List<Int32>
generic type. - Display .NET Generic Methods Using Reflection
showGenericMethods
function example. - .NET Generic Classes
Generics are classes and methods that have placeholders (type parameters or parameterized types) for one or more types.
- Accessing Items in .NET Collections
Use the
Item
property of theSystem.Collections.Generic
List
class to get or set an element at a specified index. - Call .NET Generic Methods
Example
NetDocGeneric.SampleClass
source code.