Tipos de datos .NET en MATLAB
Cuando se llama a un método o función de .NET, MATLAB convierte de forma automática los argumentos más primitivos de MATLAB en tipos de .NET. Para pasar un arreglo de cadenas, utilice la función cell
. Para pasar arreglos de otros tipos de MATLAB, use la función NET.createArray
. No es posible pasar arreglos de la estructura, arreglos dispersos o números complejos a métodos de .NET.
MATLAB convierte de forma automática los tipos de devolución .NET primitivos en tipos de MATLAB equivalentes, en caso de que existan. Para convertir un objeto System.String
, llame a la función char
. Si la función de .NET devuelve un arreglo, antes de usar los datos en un comando de MATLAB, utilice la función numérica correspondiente de MATLAB para arreglos rectangulares o la función cell
para arreglos irregulares.
Funciones
NET.createArray | Array for nonprimitive .NET types |
NET.disableAutoRelease | Lock .NET object representing RunTime Callable Wrapper (COM wrapper) |
NET.enableAutoRelease | Unlock .NET object representing RunTime Callable Wrapper (COM wrapper) |
Temas
- Pass Data to .NET Objects
MATLAB converts method arguments into .NET types.
- Handle Data Returned from .NET Objects
Mapping C# .NET types to MATLAB types.
- Pass Numeric Arguments
MATLAB automatically converts .NET numeric data to and from equivalent MATLAB data.
- Pass System.String Arguments
Examples using
System.String
arguments. - Pass Cell Arrays of .NET Data
Tips for working with contents of nested
System.Object
arrays in MATLAB. - Leer arreglos de celdas de datos de una hoja de cálculo de Excel
Este ejemplo para Microsoft® .NET Framework muestra cómo convertir columnas de datos de hojas de cálculo de Microsoft Excel® a tipos de MATLAB.
- Pass System.Enum Arguments
Examples using
System.Enum
arguments. - Pass System.Nullable Arguments
This example shows how to handle .NET methods with
System.Nullable
type arguments, whose underlying value type isdouble
. - Pass Jagged Arrays
This example shows how to create a .NET jagged array of
System.Double
using theNET.createArray
function. - Convert Nested System.Object Arrays
This example shows how to use the
cell
function to convert data in nestedSystem.Object
arrays. - Use Arrays with .NET Applications
MATLAB automatically converts arrays to .NET types, as described in the MATLAB Primitive Type Conversion Table.
- Convert .NET Arrays to Cell Arrays
Use the
cell
function to convertSystem.String
andSystem.Object
arrays to MATLAB cell arrays.
Solución de problemas
Limitations to Support of .NET Arrays
.NET features not supported in MATLAB.