MATH 372 -- Numerical Linear Algebra LU factorization in MATLAB Reading the following commands: format long A = [ 2.222 16.710 9.612; -1.5611 5.1792 -1.6855; 3.3330 15920 10.333] [L,U,P] = lu(A) P'*L*U AS = sparse(A); [L,U,P] = lu(AS,0); <- LU factorization with pivot "threshold" threshold = 0 <=> no pivoting threshold = 1 <=> full column pivoting (default) full(L) full(U) full(P) MATLAB output: A = 1.0e+04 * 0.00022220000000 0.00167100000000 0.00096120000000 -0.00015611000000 0.00051792000000 -0.00016855000000 0.00033330000000 1.59200000000000 0.00103330000000 L = 1.00000000000000 0 0 0.66666666666667 1.00000000000000 0 -0.46837683768377 -0.70416190339177 1.00000000000000 U = 1.0e+04 * 0.00033330000000 1.59200000000000 0.00103330000000 0 -1.05966233333333 0.00027233333333 0 0 0.00050719054474 P = 0 0 1 1 0 0 0 1 0 ans = 1.0e+04 * 0.00022220000000 0.00167100000000 0.00096120000000 -0.00015611000000 0.00051792000000 -0.00016855000000 0.00033330000000 1.59200000000000 0.00103330000000 ans = 1.0e+02 * 0.01000000000000 0 0 -0.00702565256526 0.01000000000000 0 0.01500000000000 9.39468853029457 0.01000000000000 ans = 1.0e+03 * 0.00222200000000 0.01671000000000 0.00961200000000 0 0.01691906543654 0.00506755724572 0 0 -4.76489719330198 ans = 1 0 0 0 1 0 0 0 1 >>