| MATLAB Function Reference | Search  Help Desk |
| feval | Examples See Also |
Syntax
[y1,y2, ...] = feval(function,x1,...,xn)
Description
[y1,y2...] = feval(function,x1, ...,xn)
If function is a 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.
Examples
The statements:[V,D] = feval('eig',A)
[V,D] = eig(A)
are equivalent. feval is useful in functions that accept string arguments specifying function names. For example, the function:
function plotf(fun,x) y = feval(fun,x); plot(x,y)can be used to graph other functions.
See Also
assignin, builtin, eval, evalin