2
//[s]=sylm(a,b) gives the Sylvester matrix associated to polynomials
3
//a and b, i.e. the matrix s such that:
4
// coeff( a*x + b*y )' = s * [coeff(x)';coeff(y)']
5
//dimension of s is equal to degree(a)+degree(b)
6
//If a and b are coprime polynomials
7
//(rank(sylm(a,b))=degree(a)+degree(b)) the instructions
8
// u = sylm(a,b) \ eye(na+nb,1)
9
// x = poly(u(1:nb),'z','coeff')
10
// y = poly(u(nb+1:na+nb),'z','coeff')
11
//compute Bezout factors x et y of minimal degree de degre minimal
15
na=degree(a);a=coeff(a)';
16
nb=degree(b);b=coeff(b)';
18
for i=1:nb,s(i:na+i,i)=a,end
19
for i=1:na,s(i:nb+i,nb+i)=b,end