function err = neuralfitfun(w41w43w31w32b2w42b4,x,y)
%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 $
pvec=w41w43w31w32b2w42b4;


z= sigm(pvec(1)*x(:,1)+pvec(2)*sigm(pvec(3)*x(:,1)+pvec(4)*x(:,2)+pvec(5)) + pvec(6)*x(:,2) + pvec(7))  ;
err = norm(z-y)

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