%%---------- virtual x-y grid
nx     = 21;  hx = 1/(nx-1);
theta  = [0:hx:1]*pi;
%%---------- generate points 
r = [0.4:0.2:1];
nr = length(r);
X   = kron(r,cos(theta)) ;
Y   = kron(r,sin(theta));
XY  = [X', Y'];
%%---------- to count # triangles 
nt=0;
%%---------- generate triangles 

for j=1:nr-1
    for i=1:nx-1
      l = (j-1)*nx + i;
      %% first triangle.....
      nt = nt+1;
     tri(nt,:) = [l, l+1, l+nx+1];
     nt=nt+1;
     %    %% second triangle 
     tri(nt,:) = [l, l+nx+1,l+nx];
    end
end
A = assmbl1(tri, XY); 
gplot(A,XY,'b-');
axis equal;
