%% Convert Discrete-Time Transfer Function to Continuous Time
% Create the following discrete-time transfer function:
% H\left( z \right) = \frac{{z - 1}}{{{z^2} + z + 0.3}}

H = tf([1 -1],[1 1 0.3],0.1);

% The sample time of the model is T_s = 0.1s.
%
% Derive a continuous-time, zero-order-hold equivalent model.

Hc = d2c(H)

%
% Discretize the resulting model, Hc, with the default zero-order hold method and sample time 0.1s to return the original discrete model, H.

c2d(Hc,0.1)

%
% Use the Tustin approximation method to convert H to a continuous time model.

Hc2 = d2c(H,'tustin');

%
% Discretize the resulting model, Hc2, to get back the original discrete-time model, H.

c2d(Hc2,0.1,'tustin');

% Copyright 2012 The MathWorks, Inc.