function [A,b] = mkd_1d(h)

x = 0:h:1;
n = length(x);

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

b = zeros(n,1);
b(2:n-1) = sin(pi*x(2:n-1)) + sin(2*pi*x(2:n-1)) + 10*sin(4*pi*x(2:n-1)) + 10*sin(8*pi*x(2:n-1)) + 10*sin(16*pi*x(2:n-1)) + 100*sin(64*pi*x(2:n-1));
