function k=taksug_out(u,y,yg,us,mask,msk_u1,msk_u2,m);
% This is used in order to solve the equation yr = ts (u) with respect to u

r={};
uu(msk_u1)=u;
uu(msk_u2)=us;
v=[y uu];
for j=1:get(m,'n_out'),
	r{j}=v(mask{j});
end

yc = eval(m,r);

k=sum((yg-yc).^2);
