%% Subplots with Different Sizes  
% Create a figure containing subplots with different sizes.   

% Copyright 2015 The MathWorks, Inc.


%% 
% Define a vector of sine values and a vector of polynomial values. 
x = linspace(-3.8,3.8);
y_cos = cos(x);
y_poly = 1 - x.^2./2 + x.^4./24;  

%% 
% Plot the sine wave in the first subplot and the polynomial in the second
% subplot. Create a third subplot that spans the lower half of the figure
% and plot both vectors together. Add titles to each subplot. 
figure
subplot(2,2,1);
plot(x,y_cos);
title('Subplot 1: Cosine')

subplot(2,2,2);
plot(x,y_poly,'g');
title('Subplot 2: Polynomial')

subplot(2,2,[3,4]);
plot(x,y_cos,'b',x,y_poly,'g');
title('Subplot 3 and 4: Both')      

