This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

.NET Delegates

In the .NET Framework, a delegate is a type that defines a method signature. It lets you pass a function as a parameter. The use of delegates enables .NET applications to make calls into MATLAB® callback functions or class instance methods. For the rules MATLAB uses to define the signature of a callback function or class method, see Reading Method Signatures. For a complete description of delegates and when to use them, consult an outside resource, such as the Microsoft® Developer Network.

There are three steps to using delegates:

  • Declaration — Your .NET application contains the declaration. You cannot declare a delegate in the MATLAB language.

  • Instantiation — In MATLAB, create an instance of the delegate and associate it with a specific MATLAB function or .NET object method.

  • Invocation — Call the function with specified input and output arguments. Use the delegate name in place of the function name.

Related Topics