% Chapter 9: Figure 9.64
%
%   Remotely controlled vehicle closed-loop system
%   step response for K=4.44, 10, and 20.
%
t=[0:0.01:10]; K=[20,10,4.44];
y=zeros(length(t),length(K));
%
for i=1:3
 numgc=K(i)*[1 2]; dengc=[1 1]; sysgc=tf(numgc,dengc);
 numg=[1]; deng=[1 2 4]; sysg=tf(numg,deng);
 syss=series(sysgc,sysg);
 sys=feedback(syss,[1]);
 y(:,i)=step(sys,t);
end
%
plot(t,y(:,1),t,y(:,2),t,y(:,3)),grid
xlabel('Time (s)'), ylabel('y(t)')