
%Test:
%%%%%%%

m=7;
x=linspace(0,1,m);
h=x(2:m)-x(1:m-1)
inind=2:m-1;
xin=x(inind);%%hin=h(inind);
d=1./h(1:m-2)+1./h(2:m-1);
ud=-1./h(2:m-2);ld=-1./h(1:m-3);
spdiags([[ud,0]', d', [0,ld]'],[-1 0 1],m-2,m-2)
full(ans)
