function demofunfun
% DEMOFUNFUN demonstration of function functions

  disp('Starting demo of function functions...');

  name = input('Enter the name of a function as a STRING: ');
  % example: user enters $'cos'$
 
  plotf(name,linspace(-10,10,10000));

function plotf(name,x)
   % evaluate the function with name $name$ with input $x$
   % $feval$ evaluates a function with given inputs
   y = feval(name,x);

   % could also use less efficient $eval(string)$ which
   % evaluates $string$ as a script command

   % now do something interesting with the values
   plot(x,y);
