clear all; close all;
num = [ 0 1 ];
den = [ 1 1 ];
Kp1 = 1.0;
Kp2 = 5.0;
Kp3 = 10.0;
numc1 = [ Kp1 ];
numc2 = [ Kp2 ];
numc3 = [ Kp3 ];
denc = [ 1 ];
sys = tf( num, den );
c1 = tf( numc1, denc );
c2 = tf( numc2, denc );
c3 = tf( numc3, denc );
sysc1 = feedback( c1*sys, 1);
sysc2 = feedback( c2*sys, 1);
sysc3 = feedback( c3*sys, 1);
t = 0:0.01:10;
[ y0, t0 ] = step( sys, t );
[ y1, t1 ] = step( sysc1, t );
[ y2, t2 ] = step( sysc2, t );
[ y3, t3 ] = step( sysc3, t );
plot(t0,y0,'-b',t1,y1,'-g',t2,y2,'-y',t3,y3,'-r');
xlim([0,10])
ylim([0.0 1.1])
xticks([0 2 4 6 8 10])
yticks([0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0])
grid;
xlabel('time t [s]');
ylabel('y(t)')
legend('K_p = 0.0','K_p = 1.0','K_p = 5', 'K_p = 10');