% f=subfun(alpha)
%
%  This computes 'FUN' at X+alpha*P.  Notice that FUN, X, and P are passed
%  in through global variables.  
%
function f=subfun(alpha)
global FUN;
global X;
global P;

f=feval(FUN,X+alpha*P);

