function retval=tikhonov(A, y, h)  
  % returns: Tikhonov-Loesung |A*x-y|+h*|y| = min.
  % h: Tikhonovparameter
  
  C = vertcat(A, h*eye(columns(A)));
  r = vertcat(y, zeros(columns(A), 1));
  [Q, R] = qr (C);
  retval = R\ ( Q\ r);
endfunction   

H=hilb(5);
y=[5.0000 3.5501 2.8138 2.3472 2.0171]';
tikhonov(H, y, 1.34e-4)

