The Polynomial Toolbox for MATLAB - DCE FEL ČVUT v Praze

The Polynomial Toolbox for MATLAB - DCE FEL ČVUT v Praze The Polynomial Toolbox for MATLAB - DCE FEL ČVUT v Praze

moodle.dce.fel.cvut.cz
from moodle.dce.fel.cvut.cz More from this publisher
22.07.2013 Views

Degrees and leading coefficients R = 2 + 3s + 6s^2 + 5s^3 In this way, new coefficients may be inserted. Thus yields R{5}=7 R = 2 + 3s + 6s^2 + 5s^3 + 7s^5 For polynomial matrices, it works similarly. Given T = [ 1+s 2 s^2 s 3 4 s^3 0 ]; the coefficient matrix of s 2 may be retrieved as T{2} ans = 0 0 1 0 0 0 0 0 Taking coefficients and taking submatrices may be combined. So the coefficients of the (1,3) entry of T follow as T{:}(1,3) ans = 0 0 1 0 The degree of a polynomial matrix is available by deg(T) ans = 3 The leading coefficient matrix, in our example that of lcoef(T) ans = 0 0 0 0 0 0 1 0 3 s may be obtained as

Constant, zero and empty matrices Values Derivative and integral A special case of polynomial matrix is that of degree 0; in effect, it is just a standard MATLAB matrix. The Polynomial Toolbox treats both these forms of data interchangeably: when a polynomial is expected, the standard matrix is also accepted. For explicit conversions, pol and double commands are available: P = pol([1 2;3 4]); D = double(P); Another special case is the zero polynomial; its degree is –Inf . Still another case: the empty polynomial matrix, similar to empty standard matrix. Its degree is empty. A polynomial may also be considered as a function of real or complex variable. For evaluating the polynomial function, the value command is available: F=2+3*s+4*s^2; X=2; Y=value(F,X) Y = 24 When F or X is a matrix then the values are evaluated entrywise: X=[2 3]; Y=value(F,X) Y = 24 47 A bit different command is mvalue. For scalar polynomial F and square matrix X, it computes the matrix value Y according to the matrix algebra rules: X=[1 2;0 1]; Y=mvalue(F,X) Y = 9 22 0 9 For matrix polynomial function Fs , the derivative and the integral are computed deriv(F) ans =

Degrees and<br />

leading<br />

coefficients<br />

R =<br />

2 + 3s + 6s^2 + 5s^3<br />

In this way, new coefficients may be inserted. Thus<br />

yields<br />

R{5}=7<br />

R =<br />

2 + 3s + 6s^2 + 5s^3 + 7s^5<br />

For polynomial matrices, it works similarly. Given<br />

T = [ 1+s 2 s^2 s<br />

3 4 s^3 0 ];<br />

the coefficient matrix of s 2 may be retrieved as<br />

T{2}<br />

ans =<br />

0 0 1 0<br />

0 0 0 0<br />

Taking coefficients and taking submatrices may be combined. So the coefficients of<br />

the (1,3) entry of T follow as<br />

T{:}(1,3)<br />

ans =<br />

0 0 1 0<br />

<strong>The</strong> degree of a polynomial matrix is available by<br />

deg(T)<br />

ans =<br />

3<br />

<strong>The</strong> leading coefficient matrix, in our example that of<br />

lcoef(T)<br />

ans =<br />

0 0 0 0<br />

0 0 1 0<br />

3<br />

s may be obtained as

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!