feval

Purpose

Function evaluation.

Synopsis

feval('function',x1,...,xn)
[y1,y2, ...] = feval('function',x1,...,xn)

Description

feval('function',x1, ...,xn) passes the arguments (x1, ...,xn) to the named function.

[y1,y2...] = feval('function',x1,...,xn) returns multiple output 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

eval, fmin, funm, ode23

(c) Copyright 1994 by The MathWorks, Inc.