MATLAB Function Reference Previous page   Next Page
feval

Evaluate function

Syntax

Description

[y1, y2, ...] = feval(fhandle, x1, ..., xn) evaluates the function handle, fhandle, using arguments x1 through xn. If the function handle is bound to more than one built-in or M-file, (that is, it represents a set of overloaded functions), then the data type of the arguments x1 through xn determines which function is dispatched to.

[y1, y2, ...] = feval(function, x1, ..., xn) If function is a quoted string containing the name of a function (usually defined by an M-file), then feval(function, x1, ..., xn) evaluates that function at the given arguments. The function parameter must be a simple function name; it cannot contain path information.

Remarks

The following two statements are equivalent.

Examples

The following example passes a function handle, fhandle, in a call to fminbnd. The fhandle argument is a handle to the humps function.

The fminbnd function uses feval to evaluate the function handle that was passed in.

See Also

assignin, function_handle, functions, builtin, eval, evalin


Previous page  ferror fft Next page

© 1994-2005 The MathWorks, Inc.