x = linspace(0, 2*pi, 30);
y = sin(x);
z = cos(x);
a = 2*sin(x) .* cos(x);
b = sin(x)./(cos(x) + eps);

subplot(2,2,1)                 % pick the upper left of 4 subplots
plot(x,y), axis([0 2*pi -1 1]), title('sin(x)')

subplot(2,2,2)                 % pick the upper right of 4 subplots
plot(x,z), axis([0 2*pi -1 1]), title('cos(x)')

subplot(2,2,3)                  % pick the lower left of 4 subplots
plot(x,a), axis([0 2*pi -1 1]), title('2sin(x)cos(x)')

subplot(2,2,4)                   % pick the lower right of 4 subplots
plot(x,b), axis([0 2*pi -20 20]), title('sin(x)/cos(x)')
