clear all; close all;
T = 1;
K = 1;
num = [ 0 K ];
den = [ T 1 ];
sys = tf( num, den );
A = 1;
omega1 = 0.01;
t1 = 0:0.1:1000;
u1 = A*sin( omega1*t1 );
x0 = [ 0 ];
[ y1, t1, x1 ] = lsim( sys, u1, t1, x0 );
figure(1)
plot(t1,u1,'-b',t1,y1,'-r');
xlim([0,1000])
ylim([-1.0 1.0])
xticks([0 200 400 600 800 1000])
yticks([-1.0 -0.5 0.0 0.5 1.0])
grid;
xlabel('time t [s]');
ylabel('input and output')
legend('input','output');
A = 1;
omega2 = 10;
t2 = 0:0.01:10;
u2 = A*sin( omega2*t2 );
x0 = [ 0 ];
[ y2, t2, x2 ] = lsim( sys, u2, t2, x0 );
figure(2)
plot(t2,u2,'-b',t2,y2,'-r');
xlim([0,10])
ylim([-1.0 1.0])
xticks([0 2 4 6 8 10])
yticks([-1.0 -0.5 0.0 0.5 1.0])
grid;
xlabel('time t [s]');
ylabel('input and output')
legend('input','output');
figure(3)
plot(t2,u2,'-b',t2,y2,'-r');
xlim([5,10])
ylim([-1.0 1.0])
xticks([5 6 7 8 9 10])
yticks([-1.0 -0.8 -0.6 -0.4 -0.2 0.0 0.2 0.4 0.6 0.8 1.0])
grid;
xlabel('time t [s]');
ylabel('input and output')
legend('input','output');