function A=lapm(m)
% Matrix for solving Laplace (Poisson) equation with 5 point. discr.
% Sparse structure.
% Arguments: m -- nr. of subintervals
%
n=m-1;  % 
N=n^2; % nr. of inner nodes = nr. of unknowns
e=ones(N,1);
d=~rem(1:N,n)==0;du=[1,d];du=du(1:N);
A=-spdiags([e,d',-4*e,du',e],[-n,-1,0,1,n],N,N);
