Using tfdata

Discussion in 'Programmer's Corner' started by cloud, Dec 20, 2006.

  1. cloud

    Thread Starter Member

    Dec 15, 2006
    11
    0
    Does anyone know know to use the function, [num,den]=tfdata(sys)? My transfer function(tf) is a double(complex). When I type [num,den]=tfdata(tf), it states that the function 'tfdata' is not defined for values of class 'double'.

    Thank you.
     
  2. Dave

    Retired Moderator

    Nov 17, 2003
    6,960
    144
    Correct, because tf (or sys in the original syntax) must be expressed in polynomial form, hence the only data-type it can accept is type int (as far as I can see both signed/unsigned and variable-bit).

    The context in which tfdata is used is:

    Code ( (Unknown Language)):
    1.  
    2. H = tf([1 2],[3 0 4]); % H = (s + 2)/(3s^2 + 4)
    3.  
    4. [num,den] = tfdata(H)
    5. num =
    6.         1 2
    7. den =
    8.         3 0 4
    9.  
    The tfdata function is only really useful when you have a transfer function expressed polynomially excapsulated within a variable, like H, and wish to extract the numerator and denominator coefficients.

    Dave

    Dave
     
Loading...