function b = makeb(top, left, right, bottom)
% MAKEB : make the right-hand-side vector for the temperature problem
%
% b = makeb(top, left, right, bottom) takes four k-vectors of 
%     boundary-condition temperatures for the cottage walls,
%     and returns the RHS vector b of dimension n = k^2.

k = length(top);
n = k^2;
b = zeros(n,1);

b(1:k) = top;
b(n-k+1 : n) = bottom;

b(1 : k : n-k+1) = left;
b(k : k : n) = right;


b(1)     = b(1)     + top(1);
b(k)     = b(k)     + top(k);
b(n-k+1) = b(n-k+1) + bottom(1);
b(n)     = b(n)     + bottom(k);