  function x = UBidiSol(u,f,b)
%
% Pre:
%  u,f  n-vectord that define the upper bidiagonal matrix
%       U = diag(u) + diag(f(1:n-1),1)
%    b  n-vector
%
% Post:
%    x  n-vector that solves Ux = b


   n = length(b); 
   x = zeros(n,1);
   x(n) = b(n)/u(n);
   for i=n-1:-1:1
      x(i) = (b(i) - f(i)*x(i+1))/u(i);
   end
