"QR_H.m" function [Q,R] = QR_tao(A) %输入矩阵A %输出正交矩阵Q和上三角矩阵R [n,n]=size(A); E = eye(n); X = zeros(n,); R = zeros(n); P1 = E; :n- s = -sign(A(k,k))*norm(A(k:n,k)); R(k,k) = -s; w = [A(,)+s,A(:n,k)']'; else w = [zeros(,k-),A(k,k)+s,A(k+:n,k)']'; R(:
作者:凯鲁嘎吉 - 博客园http://www.cnblogs.com/kailugaji/ 三.实验程序 五.解答(按如下顺序提交电子版) 1.(程序) (1)LU分解源程序: function [l,u]=lu12(a,n) for k=1:n-1 for i=k+1:n a(i,k)=a(i,k)/a(k,k); for j=k+1:n a(i,j)=a(i,j)-a(i,k)*a(k,j); end end end l=eye(n); u=zeros(n,n); for k=1:n fo