function A = myGauss(A,b)
%  Gaussian Elimination
% 
[mA,nA] = size(A) ;
[mb,nb] = size(b) ;

if mA == nA 
    if (nA==mb) && (nb==1)
        % dimensions agree
        A = [A b] ;
        n = nA ;
        % elimination  
       for    k = 1:n-1 % k is the pivot row (pivot element A(k,k))
             for i = k+1:n  % for every row 
                  L(i,k) = - A(i,k)/A(k,k) ;
                  for j = k:n+1
                       A(i,j) = A(i,j) + L(i,k)*A(k,j) ;
                  end
             end 
       end
  
    else
        error('wrong dimensions of b') ;
    end    
else
    error('A is not square');
end    



end

