% To load into Matlab:  just type the name of this file, without the .m
% extension.

clf;

xmin=0;
xmax= 30;
ymin=0;
ymax=50;
nfine = 512;
xtick=10.0;
ytick=10.0;

%% ----------------------------------------------------------------
hold on;

x=[ xmin:(xmax-xmin)/nfine:xmax];
y = 0.06 * x.^2 -6.0*exp(-0.1*(x-22).^2);
plot(x,y);

x=[ xmin:(xmax-xmin)/nfine:xmax];
y = 18.229 + 1.191*(x-18);
plot(x,y,'r');

%% ----------------------------------------------------------------
axis([xmin xmax ymin ymax]);
h1=line([xmin xmax], [0 0]);
set(h1, 'LineStyle', '--');
h2=line([0 0], [ymin ymax]);
set(h2, 'LineStyle', '--');
xlabel('t');
ylabel('y');

set(gca, 'XTick', [xmin:xtick:xmax])
set(gca, 'YTick', [ymin:ytick:ymax])

set(gca, 'XGrid', 'on')
set(gca, 'YGrid', 'on')
set(gca, 'XMinorGrid', 'on')
set(gca, 'YMinorGrid', 'on')

set(gcf, 'PaperPositionMode', 'Manual');
set(gcf, 'PaperPosition', [0 0 3.5 1.5])
print -depsc rocketfig2
