%% Discrete-Time Transfer Function with Time Delay
% This example shows how to create a discrete-time transfer function with a time delay.
% In discrete-time models, a delay of one sampling period corresponds to a factor of {z^{ - 1}} in the transfer function. For example, the following transfer function represents a discrete-time SISO system with a delay of 25 sampling periods.
% H\left( z \right) = {z^{ - 25}}{2 \over {z - 0.95}}.
% To represent integer delays in discrete-time systems in MATLAB, set the 'InputDelay' property of the model object to an integer value. For example, the following command creates a tf model representing H\left( z \right) with a sampling time of 0.1 s.

H = tf(2,[1 -0.95],0.1,'InputDelay',25)

% If system has a time delay that is not an integer multiple of the sampling time, you can use the thiran command to approximate the fractional portion of the time delay with an all-pass filter. See Time-Delay Approximation.
% Copyright 2012 The MathWorks, Inc.