% Gnew=gen_convert(G)
% Converts matrix G, with elements expressed in octal form,
% into matrix Gnew, with elements expressed in decimal form.
%
% George Ginis, May 2001

function Gnew=gen_convert(G)
  
  rows=size(G,1);
  columns=size(G,2);
  
  for i=1:rows
    
    for j=1:columns
     
      Gnew(i,j) = 0;
      digit=0;
      
      while (G(i,j) ~= 0)
      
	r = mod(G(i,j),10);
	G(i,j) = floor(G(i,j)/10);
	Gnew(i,j) = Gnew(i,j)+r*8^digit;
	digit=digit+1;
	
      end
      
    end
  
  end
