function [f,ind,p] = frob(a,tol) % function [f,ind,p] = frob(a,tol) % Uses dig.m to find the FROB-enius Normal Form 'f' of A % % ind = equivalence classes (strongly connected components) % sorted out by accessibility (left ---> right) % and separated by zeros % p = permutation matrix such that f=p*a*p' [m,n]=size(a); if m~=n 'Not a Square Matrix',break, end if (nargin==1) tol=n*eps*norm(a,'inf'); end [c,v]=dig(a,tol); if v(1,1) == 67 v, break, end % Use c to put the classes in 'decreasing' order d=v(:,1); % d is a vector of class representatives num=max(size(d)); i=1;j=2; while(i