Main Content

.NET Data Types inMATLAB

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 thecellfunction. To pass arrays of other MATLAB types, use theNET.createArrayfunction. 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 aSystem.Stringobject, call thecharfunction. 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 thecellfunction for jagged arrays.

Functions

NET.createArray 数组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)

Topics

Troubleshooting

Limitations to Support of .NET Arrays

.NET features not supported in MATLAB.