Daniel@0: function y = linef(lambda, fn, x, d, varargin) Daniel@0: %LINEF Calculate function value along a line. Daniel@0: % Daniel@0: % Description Daniel@0: % LINEF(LAMBDA, FN, X, D) calculates the value of the function FN at Daniel@0: % the point X+LAMBDA*D. Here X is a row vector and LAMBDA is a scalar. Daniel@0: % Daniel@0: % LINEF(LAMBDA, FN, X, D, P1, P2, ...) allows additional arguments to Daniel@0: % be passed to FN(). This function is used for convenience in some of Daniel@0: % the optimisation routines. Daniel@0: % Daniel@0: % See also Daniel@0: % GRADCHEK, LINEMIN Daniel@0: % Daniel@0: Daniel@0: % Copyright (c) Ian T Nabney (1996-2001) Daniel@0: Daniel@0: % Check function string Daniel@0: fn = fcnchk(fn, length(varargin)); Daniel@0: Daniel@0: y = feval(fn, x+lambda.*d, varargin{:});