Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function x = forward_elim(L, b)
- n = length(b);
- x = zeros(n, 1);
- x(1) = b(1)/L(1, 1);
- for i = 2:n
- sum = 0;
- for j = 1:i-1
- sum = sum + L(i, j) * x(j);
- endfor
- x(i) = (b(i)-sum)/L(i, i);
- endfor
- endfunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement