Using Function Handles for Anonymous Functions
Function handles also serve as the means of invoking anonymous functions. An anonymous function is a one-line expression-based MATLAB function that does not require a program file.
For example, the statement
sqr = @(x) x.^2;
creates an anonymous function that computes the square of its input argument x. The @ operator makes sqr a function handle, giving you a means of calling the function:
sqr(20)
ans =
400
Like nested functions, a handle to an anonymous function also stores all data that will be needed to resolve the handle when calling the function. Shares same issues as nested functions do.
See the documentation on Anonymous Functions for more information.