diary20050114

diary20050114 - y = L \ P*b x = U \ y clc help lu clc help...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
% Matlab diary from cs110a class #6, Jan 14 2005. % % This is what I typed in class. % % Type it into Matlab yourself to % reproduce the output I showed. A = [10 -7 0 ;-3 2 6 ; 5 -1 5] b = [7 ; 4 ;6] A \ b [L,U,P ] = lu(A) L * U P*A A b = [7 ; 4 ;6] x = A \ b [L,U,P] = lu(A) b P*b x = A \ b [L,U,P] = lu(A)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: y = L \ P*b x = U \ y clc help lu clc help lutx [L,U,p] = lutx(A) L*U - A(p,:) A(p,:) clc help lutx edit lutx A k=1 format compact [n,n] = size(A) i = k+1:n A(i,k) = A(i,k)/A(k,k) j= k+1:n A(i,k) A(k,j) A(i,k)*A(k,j) A(i,k)*A(k,j) A(i,j) = A(i,j) - A(i,k)*A(k,j)...
View Full Document

Ask a homework question - tutors are online