function A = myGauss1(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 1st column 
       for i = 2:n 
           L(i,1) = - A(i,1)/A(1,1) ;
           for j = 1:n+1
               A(i,j) = A(i,j) +L(i,1)*A(1,j) ;
           end
       end           
       % elimination 2nd column
        for i = 3:n 
           L(i,2) = - A(i,2)/A(2,2) ;
           for j = 2:n+1
               A(i,j) = A(i,j) +L(i,2)*A(2,j) ;
           end
       end           
       % elimination 3rd column
        for i = 4:n 
           L(i,3) = - A(i,3)/A(3,3) ;
           for j = 3:n+1
               A(i,j) = A(i,j) +L(i,3)*A(3,j) ;
           end
       end           
        % elimination 4th column
        for i = 5:n 
           L(i,4) = - A(i,4)/A(4,4) ;
           for j = 4:n+1
               A(i,j) = A(i,j) +L(i,4)*A(4,j) ;
           end
       end           
    else
        error('wrong dimensions of b') ;
    end    
else
    error('A is not square');
end    



end

