.NET Generic Classes inMATLAB
Create .NET generic classes, invoke .NET generic methods in MATLAB®
Generic classes are a feature of the C# programming language. These topics show how to use generic classes in MATLAB.
Functions
NET.createGeneric |
Create instance of specialized .NET generic type |
NET.invokeGenericMethod |
Invoke generic method of object |
NET.convertArray |
(Not recommended) Convert numericMATLABarray to .NET array |
Classes
NET.GenericClass |
Represent parameterized generic type definitions |
Topics
- 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. - 创建。netrrays of Generic Type
这个示例创建了一个. net数组
List
generic type. - Display .NET Generic Methods Using Reflection
showGenericMethods
function example. - .NET Generic Classes
Generics are classes and methods that have placeholders (type parameters orparameterized 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.