% Script File: ShowContour

close all

% Set up array of function values.
x = linspace(-5,4,200);
y = linspace(-2.5,6.5,200);
F = SetUp(@Elev,x,y);

% Draw 15 contours:
hold on
axis equal
axis([-5 4 -3 4])
contour(x,y,F,15);

% Generate Cross-section
[a,b] = ginput(2);
plot(a,b,'linewidth',3)
n = 100;
t = linspace(0,1,n);
x = linspace(a(1),a(2),n);
y = linspace(b(1),b(2),n);
for i=1:n
% At "time" t(i) we are at (x(i),y(i)).
% Compute elevation at time t(i).
f(i) = Elev(x(i),y(i));
end
figure % New figure
plot(t,f)