%% Convert Existing Axes to Subplot
% Create a line chart. Then convert the axes so that it is the lower subplot of the figure. The subplot function uses the figure in which the original axes existed.

x = linspace(1,10);
y = sin(x);
plot(x,y)
title('Sine Plot')

%

ax = gca;
subplot(2,1,2,ax)

% Copyright 2012 The MathWorks, Inc.