blob: 860486da78a813fde8711bbadbf07c32bae9b420 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
|
function [L U] = LU (A)
[n n1] = size (A);
[L U] = deal (eye (n), A);
for k = 1:n
for i = k + 1 : n
L(i, k) = U(i, k) / U(k, k);
U(i, :) = U(i, :) - L(i, k)*U(k, :);
end
end
end
|