This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: [L11, U11] = hw3lu (A11) ; % triangular solve for L21 (solve L21 * U11 = A21 for L21): L21 = A21 / U11 ; % triangular solve for U12 (solve L11 * U12 = A12 for U12): U12 = L11 \ A12 ; % Let L22 = 1 L22 = 1 ; % compute U22 by solving L21*U12 + L22*U22 = A22 for U22: U22 = A22 - L21*U12 ; % glue the results together L = [L11 zeros(n-1,1) ; L21 L22] ; U = [U11 U12 ; zeros(1,n-1) U22] ; end...
View Full Document
- Fall '08