%% Step Response Plot of Feedback Loop with Delay
% Create a feedback loop with delay and plot its step response.

s = tf('s');
G = exp(-s) * (0.8*s^2+s+2)/(s^2+s);
T = feedback(ss(G),1);
step(T)

% The system step response displayed is chaotic. The step response of systems with internal delays may exhibit odd behavior, such as recurring jumps. Such behavior is a feature of the system and not software anomalies.
% Copyright 2015 The MathWorks, Inc.