function retval = Tridiag(n,a,b,c)
# usage: Tridiag(n,a,b,c)
# description: returns tridiagonal matrix with diags a,b,c of size n

# local variables:
# ii,jj: index variables

retval = zeros(n,n);
retval(1,1) = b;
retval(1,2) = c;
retval(n,n-1) = a;
retval(n,n) = b;
for ii = 2:(n-1)
  retval(ii,ii-1) = a;
  retval(ii,ii) = b;
  retval(ii,ii+1) = c;
endfor;

endfunction

#
