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

clf;

xmin=0;
xmax=60;
ymin=0;
ymax=60;
xtick=10;
ytick=10;

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

x=[0:0.1:20];
y=2*x+20;
plot(x,y);

x=[20:0.1:40];
y=-x+80;
plot(x,y);

x=[40:0.1:60];
y=0*x+40;
plot(x,y);

%% ----------------------------------------------------------------
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('G(t)');

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 2.0 2.0])
print -depsc e2G
