% I encourage you to try all these commands in the command line, without
% the semi-colons, to see what they print out

n=3;
h=1/(n+1); % step size
xtest=1/2; % value of x from 0 to 1 where we test the error

K=toeplitz([2 -1 zeros(1,n-2)]); % fixed-fixed
f=ones(n,1); % right-hand side

u=(1/h^2)*K\f; % solution

ut=-(1/2)*(xtest^2)+xtest/2; % true solution at test point

e=abs(u(round(xtest/h))-ut) % error at test point
