% hilbertproblems.m format compact for n = 2:8 n H = hilb(n) condition_est = cond(H) x = ones(n,1)/3; b = H*x; % now try to recover x xc = H\b % see how bad answer is residual = H*xc - b rel_residual_norm = norm(residual,inf)/norm(b,inf) error = xc - x rel_error_norm = norm(error,inf)/norm(x,inf) end