Transfer functions with delays in Matlab

I was wondering how to use delays in transfer functions. First I modeled the delay explicity with the e function. In this example I create the laplace variable s and use it in my transfer function Tf.


s = tf('s')
Tf = exp(-s) * G

In a forum I read about the function fieldnames() which lists all the argument names that a given matlab function takes.


fieldnames(tf)

ans = 

    'num'
    'den'
    'ioDelay'
    'Variable'
    'Ts'
    'InputDelay'
    'OutputDelay'
    'InputName'
    'OutputName'
    'InputGroup'
    'OutputGroup'
    'Name'
    'Notes'
    'UserData'

The list of the argument names of tf() contains ioDelay and that’s what can be used to delay a transfer function. Because matlab functions take a variable amount of arguments you cannot just type in


G = tf( 1, 1)

for the system 1 with a delay of one second as the second argument. The first argument is the numerator and the second the denumerator in this case. If you don’t use the standard order of arguments you have to list the arguments as matlab_function(‘fieldname1′, value1, ‘fieldname2′, value2, …).

Example:


G = tf( 1, 'ioDelay', 1)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>