Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

Using .NET from MATLAB: An Overview

What Is the Microsoft .NET Framework?

The Microsoft .NET Framework is an integral Windows component that provides a large body of precoded solutions to common program requirements, and manages the execution of programs written specifically for the Framework.

MATLAB software supports the .NET Framework on the Windows platform only.

Benefits of the MATLAB .NET Interface

The MATLAB .NET interface enables you to:

Why Use the MATLAB .NET Interface?

Use the MATLAB .NET interface to take advantage of the capabilities of the Microsoft .NET Framework. For example:

Limitations to .NET Support

MATLAB supports the .NET features C# supports, except for the limits noted in the following table.

Features Not Supported in MATLAB
Cannot use ClassName.propertyname syntax to set static properties. Use NET.setStaticProperty instead.
Unloading an assembly
Passing a cell array, structure array, sparse array, or complex number to a .NET property or method
Subclassing .NET classes from MATLAB
Accessing nonpublic class members
Displaying generic methods using methods or methodsview functions
Creating an instance of a nested class
Saving (serializing) .NET objects into a MAT-file
Creating .NET arrays with a specific lower bound
Creating ragged (nonrectangular) .NET arrays
Concatenating multiple .NET objects into an array
Implementing interface methods
Hosting .NET controls in figure windows
Casting operations
Delegates, except for events
Non-Int32 underlying types for enumerations
Calling constructors or NET.invokeGenericMethod with ref or out type arguments
Using System.Console.WriteLine to write text to the command window
Pointer type arguments, function pointers, System.Nullable type, Dllimport keyword
Calling methods with default arguments (System.Reflection.Missing.Value not supported.)
.NET remoting
Auto-conversion of multidimensional arrays
Using the MATLAB: (colon) operator in a foreach iteration
Support for .NET objects which are a wrapper of a COM object (commonly used by Microsoft Office 2007 applications)

What's the Difference Between the MATLAB .NET Interface and MATLAB Builder NE?

The MATLAB .NET interface is for MATLAB users who want to use .NET assemblies in MATLAB.

MATLAB® Builder™ NE (previously called .NET Builder) packages MATLAB functions so that .NET programmers can access them. It brings MATLAB into .NET applications. For more information about this product, follow the instructions for accessing Product Documentation at the MathWorks Web Site in the MATLAB Desktop Tools and Development Environment documentation.

Requirements

The MATLAB interface to .NET is available on the Windows platform only.

You must have the Microsoft .NET Framework installed on your system. The MATLAB interface supports the features of the .NET Framework Version 2.0, and works with Version 2.0 or above.

To use a .NET application, refer to your product documentation for information about how to install the program and for details about its functionality.

Using a .NET assembly in MATLAB

For an example of using .NET in MATLAB, see:

For detailed information, see:

To Learn More About the .NET Framework

For a complete description of the .NET Framework, you need to consult outside resources.

One source of information is the Microsoft Developer Network at http://msdn.microsoft.com/en-us/default.aspx. You can explore the .NET Framework Development Center or search the MSDN® site for the term ".NET Framework". The .NET Framework Class Library is a programming reference manual. Many examples in this documentation refer to classes in this library. There are different versions of the .NET Framework documentation. See Requirements for information about version support in MATLAB.

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2010- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS