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LJklqK92Xoa295G3WokdDK+lRZ/eYxTzt27Sk7T6FzFFWh9OVsbs58UEQQ9LlYDhRGV+mP9OVsX/EPwbqX4B3S7jGwS7HyWQsqRxXqIxxkfm0sK/+FIQf0lMy1kX53VoDMsYQsF0ZOxH2EpnQ6KqwsMA4uHQv5cbSGeXgisoYHQFXkFfB5/ddTXiVzPgY5XfFvXZkr6iMMeI1Bu9Uoya8ypiMGTV2gVFZnTGSgO3KWEtFxo4FGwa4SnXG8srvFuq1I1s/Xl8HhQgqunuJFIRXqcsYWGCJNsuUsa/GZQ/YqUYNecbyyo3J8+OuyafAooOKx95qiy/HH2vaSu8ql5fA4gHKve9J1zbtaZUxdpSxvPL26mm20owhlWMgksKGy9TLex+7+e52r5jwWnXKtxt6KbfXRSqHwaWGDdCwy+fx3vSrcfvj5EabtmUunRXK7wJ2WR9TnikbDJ0gNsBWI7S2BckYJ0u7wKiJjfy7iIS718h4JV7WDdiujIG8IGb2l9hIJV6WDtiujOEsHbN3K6cV/wO1OEJWbFZQ0orKCTW3LCBRiKVRxoSoRRkTohZlTIhalDEhalHGhKhFGROiFmVMiFqUMSFq+QN0aAf5Je+23wAAAABJRU5ErkJggg==

s = tf('s');
k=6.95
G = (k*100)/((s + 10)*(s + 20));
Gd = c2d(G, 0.01,'foh') % first order hold
sys_cl = feedback(G,1)
sys_cld = feedback(Gd,1)
step(sys_cl,'--',sys_cld,'-')

 Sampling time = 0.01 sec




Step response in z-domain (ZOH)


 

s = tf('s');
k=6.95   % from root locus plots in s domain
G = (k*100)/((s + 10)*(s + 20));
Gd = c2d(G, 0.1) % zoh is the default method
sys_cl = feedback(G,1)
sys_cld = feedback(Gd,1)
step(sys_cl,'--',sys_cld,'-')

Sampling time = 0.1 sec





Sampling time = 0.01 sec






Sampling time = 0.001 sec



MATLAB’s “c2d” command convert from continuous to discrete transfer functions. The methods of conversion include the Tustin approximation and a zero-order hold on the input to the transfer function.

Zero-order hold (ZOH)

Zero-order hold (ZOH) devices convert sampled signals to continuous-time signals for analyzing
sampled continuous-time systems.
G(s) =10/(s^2 + 3s + 10)

G = tf(10,[1 3 10]); % create transfer function
Gd = c2d(G, 0.1) % zoh is the default method
step(G,'--',Gd,'-')



 http://www.mathworks.com/help/control/continuous-and-discrete-time-conversion.html