%aufgabe 4 t = (0.1:0.1:1.0)' f = [100 34 17 12 9 6 5 4 4 2]' A = [1./t 1./t.^2 exp(-(t-1)) exp(-2*(t-1))] %grad = 0 mit Gauss gamma_g = (A'*A)\(A'*f) %qr-zerlegung [Q R_s] = qr(A) R = [-,1-size(R_S)(1)] gamma_qr = R\(U'*f) %konditionszahlen cond(A) cond(A'*A) t_f = linspace(0.1,1.0,1000)'; f_g = [1./t_f 1./t_f.^2 exp(-(t_f-1)) exp(-2*(t_f-1))] * gamma_g; f_qr = [1./t_f 1./t_f.^2 exp(-(t_f-1)) exp(-2*(t_f-1))] * gamma_g; semilogy(t,f,'O',t_f,f_g,'-',t_f,f_qr,'.')