x = 0:0.1:4*pi;
y1 = sin(x);
figure(1);
subplot(211);
plot(x, y1);
title('y = sin(x)');
axis([0 4*pi -1 1]);
pause;
subplot(212);
y2 = cos(x);      
plot(x, y2);
title('y = cos(x)');
axis([0 4*pi -1 1]);

pause;
figure(2);
plot(x, y1);
hold on;
pause;
plot(x, y2);
hold off;
axis([0 4*pi -1 1]);

