Code covered by the BSD License  

Highlights from
highest row degree coefficient matrix of a polynomial matrix T(s)

highest row degree coefficient matrix of a polynomial matrix T(s)

by

 

27 Apr 2012 (Updated )

This function computes the highest row degree coefficient matrix of polynomial matrix T(s).

Tl=rowdeg(T);
function Tl=rowdeg(T);
%computes the highest row degree coefficient matrix of poynomial matrix T
[rows,columns]=size(T);
for i=1:rows %for each row:
    for j=1:columns
        K(j)=size(sym2poly(T(i,j)),2); %computes the degree of each polynomial 
    end
        k=max(K); %get the maximum degree of all polynomials in the same row
        for m=1:columns %second inner loop
            if K(m)==k
            p=sym2poly(T(i,m));  %if the polynomial in thsi place is of the highest degree in this row
            Tl(i,m)=p(1,1); %then in Tl(i,m) we put the coefficient Cn of Cn*(s^n) 
            else
            Tl(i,m)=0;
            end
        end
end
%example We in put the matrix T= 
%        [ s^2+3*s,     s+1]
%     T= [     5*s,     s^4]
%        [   5*s^6,     s^2]
%        [ 3*s^3+6,   s^3+5] and get
%     ans =
%       1     0
%       0     1
%       5     0
%       3     1

Contact us