Analisis-practica3 - An´lisis Num´rico a e Reflexiones...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: An´lisis Num´rico a e Reflexiones de Householder y Rotaciones de Givens 26 de marzo de 2011 Ejercicio 1. Implemente en matlab el m´todo de las reflexiones de Householder para la e descomposici´n QR de cualquier matriz A ∈ Rnxm o function [Q,R]=desqr2(A) [Q,R]=(A) Q=eye(m); if (n<m) q=n; else q=m-1; end for k=1:q a=A(k:m,k); norma=norm(a); beta=1/(norma*(norma+abs(a(1)); u=a+sign(a(1))*norm(a)*[1;zeros(m-k,1)]; Q k=eye(m); Q k(k:m,k:m)=eye(m-k+1)-beta*u*u’; A=Q k*A: Q=Q k*Q; end R=triu(A); Q=Q’; Ejercicio 2. Implemente en matlab el M´todo de las rotaciones de Givens para la descome nxn posici´n QR de cualquier matriz A ∈ R o 1 function [Q,R]=desgqr(A) n=size(A); n=n(1); Q=eye(n); for k=1:n-1 Gk=eye(n); for i=k+1:n if abs(A(k,k))>abs(A(i,k)) t=A(i,k)/A(k,k) c=1/sqrt(1+t2) s=c*t; else t=A(k,k)/A(i,k) s=1/sqrt(1+t2) c=s*t end G=eye(n); G(k,k)=c; G(k,i)=s; G(i,k)=-s; 2 ...
View Full Document

This note was uploaded on 03/27/2011 for the course MATHEMATIC 504 taught by Professor Carlostrujillo during the Winter '09 term at Buena Vista.

Page1 / 2

Analisis-practica3 - An´lisis Num´rico a e Reflexiones...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online