Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

Data Types

Data conversion, pass data between MATLAB® and .NET

When you call a .NET method or function, MATLAB automatically converts most primitive MATLAB arguments into .NET types. To pass an array of strings, use the cell function. To pass arrays of other MATLAB types, use the NET.createArray function. You cannot pass structure arrays, sparse arrays, or complex numbers to .NET methods.

MATLAB automatically converts primitive .NET return types to equivalent MATLAB types, if they exist. To convert a System.String object, call the char function. If the .NET function returns an array, before using the data in a MATLAB command, use the corresponding MATLAB numeric function for rectangular arrays, or the cell function for jagged arrays.

Functions

cell Create cell array
NET.createArray Array for nonprimitive .NET types
NET.disableAutoRelease Lock .NET object representing a RunTime Callable Wrapper (COM Wrapper) so that MATLAB does not release COM object
NET.enableAutoRelease Unlock .NET object representing a RunTime Callable Wrapper (COM Wrapper) so that MATLAB releases COM object
Was this topic helpful?