Source code backward dan forward substitution
//Forward Substitution Ly=B y(1,1) = b(1)/l(1,1); for i = 2:n y(i,1)=(b(i)-l(i,1:i-1)*y(1:i-1,1))./l(i,i); end //Backward substitution Ux=y x(n,1) = y(n)/u(n,n); for i = n-1:-1:1 x(i,1)=(y(i)-u(i,i+1:n)*x(i+1:n,1))./u(i,i); end if x==0 then printf('Trivial atau penyelesaian nol\n') end
Sumber: https://www.youtube.com/watch?v=4mOFl6VvH-0
0 komentar:
Posting Komentar