
function A=Lap2Dsq(N)
#createx (N-1)^2 X (N-1)^2 matrix of 2D FD laplacian approx on the square
#(multiplied by h^2)
A1=2*sparse(diag(ones(N-1,1)))-sparse(diag(ones(N-2,1),1));
A1=sparse(A1);
A1=A1+A1';
I=-speye(N-1);
B=[A1,I;I,A1];
M=(N-1)*(N-1);
A=sparse(zeros(M,M)); 
for k=1:N-2,
 j=1+(k-1)*(N-1);
 l=j+2*(N-1)-1;
 A(j:l,j:l)=B;
endfor
endfunction
