function err = neuralfitfun2(w31w32b3w41w42b4w51w52b5,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=w31w32b3w41w42b4w51w52b5;


z= sigm(pvec(10)*sigm(pvec(1)*x(:,1)+pvec(2)*x(:,2) +pvec(3))+pvec(11)*sigm(pvec(4)*x(:,1)+ pvec(5)*x(:,2)+(pvec(6)) + pvec(12)* sigm(pvec(7)*x(:,1)+pvec(8)*x(:,2)+pvec(9)) +pvec(13)));

err = norm(z-y)

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