function [A,b] = mkd1d(f,h)

n = ceil(1/h)-1;
h = 1/(n+1);

e = ones(n,1)/h^2;
A = spdiags([-e 2*e -e], -1:1, n, n);

x = h:h:1-h;
b = feval(f,x)';

end

