n=5;
d=1.91*ones(1,n);
u=ones(1,n-1);
l=ones(1,n-1);
b=2+sin(1:n);

c=b./d;
u=u./d(1:end-1);
l=l./d(2:end);
x=zeros(size(c));
for k=1:100, 
    x(1)=-u(1)*x(2)+c(1);
    for i=2:n-1,
	x(i)=-l(i-1)*x(i-1)-u(i)*x(i+1)+c(i);
    end;
    x(n)=-l(n-1)*x(n-1)+c(n);
end;
x=zeros(size(c));
xx=x;
for k=1:100, 
    xx(1)=-u(1)*x(2)+c(1);
    for i=2:n-1,
	xx(i)=-l(i-1)*x(i-1)-u(i)*x(i+1)+c(i);
    end;
    xx(n)=-l(n-1)*x(n-1)+c(n);
    x=xx;
end;



