%% YOURNAME (DUEDATE)
%
% *IMPORTANT:*
%
% Do not change *anything* in this header (besides your
% name and due date above as needed)!
%
% Put your solution to the exercise completely at the end
% of this file.
%
%%
% <latex>
% % for Octave, or for Matlab published to LaTeX for proclatex
% \input{../setup.tex}
% </latex>
%
%% FOR, IF, WHILE, Exercise 7

if ~exist('___code___','var') ; clear ; end
format compact
more off


%% EXERCISE DESCRIPTION:
%
% Compute and plot power line sag.  This is an improved
% version of an earlier script.  It uses |if| statements
% to better allow for different values of the number of
% points |n| along the power line.
%
% The equations to solve are:
%
%                h(1)        == H
%       h(1) - 2 h(2) + h(3) == rho/(n-1)^2
%       h(2) - 2 h(3) + h(4) == rho/(n-1)^2
%       h(3) - 2 h(4) + h(5) == rho/(n-1)^2
%                ...         == rho/(n-1)^2
%   2 h(n-1) - 2 h(n)        == rho/(n-1)^2
%
% where |H| and |rho| are 1.
%
%% Hints
%
% * The correct solution to the original exercise should
% already be posted.  Just make the requested changes.


%% SOLUTION:


