
function A=tridiagsp(a,b,c,n)

   e = ones(n,1);
   A = spdiags([a*e b*e c*e],-1:1, n,n); A(1,n) = a; A(n,1) = c;
%  A = spdiags([a*e b*e c*e],-1:1, n,n); 
