
  %--------------------------------
    function  Y = GAUSS(A,F,neq)
  %--------------------------------
      
  %-------------------------
  % Begin forward elimination
  %-------------------------
    for I = 1:(neq-1) 
       for J=(I+1):neq
         FAC=-A(J,I)/A(I,I);
         for K=I:neq
           A(J,K)=A(J,K)+FAC*A(I,K);
         end
         F(J)=F(J)+FAC*F(I);
       end
    end
      
  %------------------------ 
  % Begin back substitution 
  %------------------------ 
    Y(neq)=F(neq)/A(neq,neq);
      for Iback=2:neq
        I=neq-Iback+1;
        for J=(I+1):neq
          F(I)=F(I)-A(I,J)*Y(J); 
        end
        Y(I)=F(I)/A(I,I); 
    end

