summaryrefslogtreecommitdiff
path: root/50/DEPENDENCIES/LandU.sce
blob: fee5d09ea5226de617fcf4941b9d250eea798efe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
function [U,L]=LandU(A,n)
    U=A
    L=eye(n,n)
    for p=1:1:n-1
        for i=p+1:1:n
            m=A(i,p)/A(p,p);
            L(i,p)=m;
            A(i,:)=A(i,:)-m*A(p,:);
            U=A;
        end
    end
endfunction