function [V,D] = sys_symb(A)
[m,n] = size(A);
err = .5*ones(m,1);
if m ~= n 
   fprintf('matrix must be square')
   break
end
[V,D] = eig(A); V1 = V;
% scale eigenvectors to reveal integral coefficient forms (if possible)
for i = 1:m
   vmax = abs(V(1,i));
   for j = 2:m
      vmax = max(vmax,abs(V(j,i)));
   end    
   if vmax == 0
      fprintf('defective eigenproblem (sorry!)')
   end
%  scale i-th eigenvector by its absolute-maximum component
   V(:,i) =  V(:,i)/vmax;
   kk = 0; j=1;
   while kk == 0 & j <= 10000
% multiply the i-th eigenvector by j (which can become as large as 10000 here)
% and check how close to an integer are the resulting components
      V1(:,i) = V(:,i)*j;
%  this adds up the distance of each component to the nearest integer;
%  if it is acceptably small, then this scaled eigenvector is accepted 
%  as the  desired integer-component form sought
      if sum(abs(abs(V1(:,i)) - floor(abs(V1(:,i))+err))) <= .0001
         V(:,i) = V1(:,i);
         kk = 1;
      end
      j = j+1;
   end
end
