Algoritma faktorisasi LU dengan metode crout
Source program MATLABnya adalah seperti berikut
function [l, u]=crout(a) n=size(a,1) for j=1:n, m(j,1)=a(j,1) u(j,j)=1 end for k=2:n, u(1,k)=a(1,k)/m(1,1) end for j=2:n, for k=2:j, m(j,k)=a(j,k)-m(j,1:k-1)*u(1:k-1,k) end for k=j+1:n u(j,k)=(a(j,k)-m(j,1:j-1)*u(1:j-1,k))/m(j,j); end end l=m endfunction
Sumber: https://www.youtube.com/watch?v=3SZrUARfRGc
0 komentar:
Posting Komentar