function b=compn(a)
%COMPN   Create companion matrix
%        b=compn(a) takes the polynomial a=[a0,a1, .. an]  and creates 
%        the associated companion matrix 
%                
%             b= [a0 a1 a2 ...  an-1 an;
%                  1  0  0         0  0;
%                  0  1  0 ...     0  0;
%                  :               :  :;
%                  0  0  0 ...     1  0];              
%
a=a(:)';
[r,c]=size(a);
b=[eye(c-1);zeros(1,c-1)]';
b=[a;b];
