%solution of heat conduction equation with fixed temp b.c.
  n=20;
  %tri-diagonal coeffients
  a=diag(eye(n));
  b=-2*diag(eye(n));
  c=diag(eye(n));
  d=diag(zeros(n));
  a(1)=0; c(n)=0;
  %modify coeffts for b.c. - full domain
  a(n)=0; c(1)=0;
  b(1)=1; b(n)=1;
  d(1)=100; d(n)=20;
  %call tri-diagonal solver
  [t]=trid(a,b,c,d)