function err = myfitfunslow(abcde,x,y,handle)
%FITFUN Used by FITDEMO.
%   FITFUN(lambda,t,y,handle) returns the error between the data and the values
%   computed by the current function of lambda.
% 
%    modified by VdS from
%   Copyright 1984-2002 The MathWorks, Inc. 
%   $Revision: 5.8 $  $Date: 2002/04/15 03:36:42 $




% evaluate the function with the given parameters at the data values x
z= abcde(1)*x+abcde(2)*x.^2 + abcde(3)*exp(-abcde(4)*x) + ones(length(x),1)*abcde(5);  
% compute the error from the actual given values y
err = norm(z-y);

set(gcf,'DoubleBuffer','on');
set(handle,'ydata',z)
drawnow
pause(.04)
