doolittle decom
TRANSCRIPT
-
8/16/2019 Doolittle Decom
1/3
Date:
Exp:
LU DOOLITTLE DECOMPOSITION
PROGRAMMING CODE:
clear;
clc;
A=input(enter t!e "atrix#;
$" n%=&i'e(A#;
L='er&(&i'e(A##;
U='er&(&i'e(A##;
U()*:#=A()*:#;
L(:*)#=A(:*)#+U()*)#;
,r -=.:",r i=.:"
,r /=i:"
U(i*/#=A(i*/#01t(L(i*):i0)#*U():i0)*/##;
en1
L(i*-#=(A(i*-#01t(L(i*):-0)#*U():-0)*-###+U(-*-#;
en1
en1
,print,(l2er trian3luar "atrix#;
L
,print,(upper trian3ular "atrix#;U
-
8/16/2019 Doolittle Decom
2/3
OUTPUT:
1. enter the matrix[4 12 -16;12 37 -43;-16 -43 98]
lower trianl!ar matrix
" #
1 $ $
3 1 $
-4 % 1
!&&er trian!lar matrix
U #
4 12 -16
$ 1 %
$ $ 9
2. enter the matrix[1 2 3 4 %;2 6 7 8 9;3 7 1$ 11 12;4 8 11 1314;% 9 12 14 1%]
lower trianl!ar matrix
" #
1.$$$$ $ $ $ $
2.$$$$ 1.$$$$ $ $ $
3.$$$$ $.%$$$ 1.$$$$ $ $
4.$$$$ $ -2.$$$$ 1.$$$$ $
%.$$$$ -$.%$$$ -%.$$$$ 2.2$$$ 1.$$$$
-
8/16/2019 Doolittle Decom
3/3
!&&er trian!lar matrix
U #
1.$$$$ 2.$$$$ 3.$$$$ 4.$$$$ %.$$$$
$ 2.$$$$ 1.$$$$ $ -1.$$$$
$ $ $.%$$$ -1.$$$$ -2.%$$$
$ $ $ -%.$$$$ -11.$$$$
$ $ $ $ 1.2$$$