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

clf;

xmin= 0;
xmax= 5;
ymin=-2;
ymax= 8;

nfine = 512;
ncoarse = 8;

x=[ xmin:(xmax-xmin)/nfine:xmax];
y = 3+4*sin(pi/2*(x-1));
plot(x,y);
hold on;

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

plot([0,1,2,3,4,5],[-1,3,7,3,-1,3],'o');

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

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

