x = zeros((N+1)^2,2);
icone = zeros(N^2,4);

nodo=0;
h = 1/N;
for j=1:N+1
	for l=1:N+1
		nodo = nodo+1;
		x(nodo,1)=(j-1)*h;
		x(nodo,2)=(l-1)*h;
	end
end
elem=0;
for l=1:N
	for j=1:N
		elem = elem+1;
		base = (l-1)*(N+1)+j;
		icone(elem,:) = [base,base+1,base+N+2,base+N+1];
	end
end
icone = [icone(:,[1 3 2]);
	    icone(:,[3 1 4])];
	    
tol = 1e-5;
indx = find(abs(x(:,1))<tol |
		abs(x(:,1)-1)<tol |
		abs(x(:,2))<tol |
		abs(x(:,2)-1)<tol);

fijacion = [indx,zeros(size(indx))];

iconeh=[];
for k=1:4
   if (k==1) 
     nodos = find(abs(x(:,1))<tol);
   elseif k==2
     nodos = find(abs(x(:,1)-1)<tol);
   elseif k==3
     nodos = find(abs(x(:,2))<tol);
   else
     nodos = find(abs(x(:,2)-1)<tol);
   endif
   iconeh = [iconeh;
             nodos(1:N),nodos(2:N+1)];
end