Page 62 - MATLAB an introduction with applications
P. 62

MATLAB Basics ——— 47

                                      x′ = Ax + Bu
                                      y = Cx + Du
                   The function has four output matrices:
                   [A, B, C, D] = zp2ss(z, p, k)  Determines the matrices A, B, C, and D of the control-canonical form state-
                                             space equations. p is a column vector of the pole locations of the zero-pole-
                                             gain transfer function, z is a matrix of the corresponding zero locations, having
                                             one column for each output of a multi-output system, k is the gain of the zero-
                                             pole-gain transfer function. In the case of a single-output system, z is a
                                             column vector of the zero locations corresponding to the pole locations of
                                             vector p.
                   Example Problems and Solutions
                   Example E1.7: Consider the function
                                     ns
                                      ()
                                 () =
                               Hs
                                       ()
                                     ds
                                       2
                                   3
                               4
                   where n(s) = s  + 6s  + 5s  + 4s + 3
                                   4
                               5
                         d(s) = s  + 7s  + 6s  + 5s  + 4s + 7
                                       3
                                            2
                       (a) Find n(–10), n(–5), n(–3) and n(–1)
                       (b) Find d(–10), d(–5), d(–3) and d(–1)
                       (c) Find H(–10), H(–5), H(–3) and H(–1)
                   Solution:
                   (a) >> n=[1 6 5 4 3];    % n=s^4+6s^3+5s^2+4s+3
                       >> d=[1 7 6 5 4 7]; % d=s^5+7s^4+6s^3+5s^2+4s+7
                       >> n2=polyval(n,[–10])
                       n2=4463
                       >> nn10=polyval(n,[–10])
                       nn10=4463
                       >> nn5=polyval(n,[–5])
                       nn5=–17
                       >> nn3=polyval(n,[–3])
                       nn3=–45
                       >> nn1=polyval(n,[–1])
                       nn1=–1
                   (b) >> dn10=polyval(d,[–10])
                       dn10=–35533
                       >> dn5=polyval(d,[–5])
                       dn5=612
                       >> dn3=polyval(d,[–3])









                   F:\Final Book\Sanjay\IIIrd Printout\Dt. 10-03-09
   57   58   59   60   61   62   63   64   65   66   67