function Z=gausselim(a)
%  Gaussin eliminointi HA 2.11.08
%  Esim:   n=4;  A=hilb(n); b=ones(n,1); RefAb=gausselim([A b])
[m,n]=size(a);
for i=1:m-1
    for k=i+1:m
        m(k,i)=a(k,i)/a(i,i);
        a(k,:)=a(k,:)-m(k,i)*a(i,:);
    end    
end
Z=a;