% this demonstrates how you can get elevation profiles.
% it also demostrates basic plotting commands.

%here is a command that gets elevations in a rectangle between 100W and
%130 W for latitudes around Seattle (47 N)
[elevations,long_out,lat_out]=m_elev([-130 -100 47 47.5]);
% this returned results for two latitudes

% make a new window and plot a cross section of elevations through
% Washington:
figure(5)
plot(long_out(1:2,:)',elevations(1:2,:)')
%this plotted both profiles connecting along the longitudes.  Try removing
%the ' and you will see a plot with the points connected by latitude.  Also
%try plotting a profile at just one latitude


%add labels:
xlabel('Longitude')
ylabel('Elevation (m)')
title('Elevation cross-section through Seattle')

%if you use the following command (remove the commenting %) you can change
%the limits of the plot from 110W to 100W and from -300 m to 5000 m.
%axis([-110 -100 -300 5000])