%

for n = 4:4:20
  A = hilb(n); b = (1:n)';
  tic;
  x = A\b;
  t1 = toc;
  nm1 = norm(b-A*x);

  tic;
  x = inv(A)*b;
  t2 = toc;
  nm2 = norm(b-A*x);
  
  disp(' n    op_time    op_acc    inv_time   inv_acc');
  fprintf('%2.0f %10.2e %10.2e %10.2e %10.2e\n', ...
          n, t1, nm1, t2, nm2);
end;
