Function Handles - MATLAB & Simulink (original) (raw)

Main Content

Variables that allow you to invoke a function indirectly

A function handle is a MATLAB® data type that represents a function. A typical use of function handles is to pass a function to another function. For example, you can use function handles as input arguments to functions that evaluate mathematical expressions over a range of values.

Function handles can represent either named or anonymous functions. To create a function handle, use the @ operator. For example, create a handle to an anonymous function that evaluates the expression _x_2 –_y_2:

f = @(x,y) (x.^2 - y.^2);

For more information, see Create Function Handle.

Functions

Topics