next up previous contents
Next: LOADLIB Load Library Function Up: FreeMat Functions Previous: SOURCE Execute an Arbitrary   Contents

Subsections

FEVAL Evaluate a Function

Usage

The feval function executes a function using its name. The syntax of feval is

  [y1,y2,...,yn] = feval(fname,x1,x2,...,xm)

where fname is the name of the function to evaluate, and xi are the arguments to the function, and yi are the return values.

Example

Here is an example of using feval to call the cos function indirectly.

--> feval('cos',pi/4)
ans = 
  <double>  - size: [1 1]
    0.707106781186548



Samit K. Basu 2005-03-16