Clases genéricas de .NET en MATLAB
Las clases genéricas son una funcionalidad del lenguaje de programación C#. En estos temas se muestra cómo utilizar clases genéricas en MATLAB.
Funciones
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 |
Clases
NET.GenericClass | Represent parameterized generic type definitions |
Temas
- Create .NET Collections
This example uses two
System.Stringarrays,d1andd2, to create a generic collection list. - Convert .NET Collections to MATLAB Arrays
Use the
ToArraymethod of theSystem.Collections.Generic.Listclass 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
showGenericMethodsfunction 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
Itemproperty of theSystem.Collections.GenericListclass to get or set an element at a specified index. - Call .NET Generic Methods
Example
NetDocGeneric.SampleClasssource code.