function [L,U]=LUplain(a)
% HA 5.10.08
%  Gaussin eliminointi ja LU ilman rivinvaihtoja  
  %  Esim:    A=hilb(4); b=ones(n,1); [L,U]=LUplain([A b])
[m,n]=size(a);
L=eye(size(a));
for i=1:m-1
    for k=i+1:m
        L(k,i)=a(k,i)/a(i,i);
        a(k,:)=a(k,:)-L(k,i)*a(i,:);
    end    
end
U=a;
