function err = hw4fitfun(c,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 $


%%%%% put code to compute err here  (4 lines-see myfitfun.m from class
%%%%% notes) for example

%%%%%%%% 
%% the last lines allow incremental drawing -- leave these as is for
%% Question 4
%% BUT FOR QUESTION 5 comment them out (by putting the % symbol before
%% each line  

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