  function filloct(X,Y,D) 
  
    %  poprawka funkcji fill dla octave 
    %  AUTOR: Piotr Pluciński, PK WIL L-10

     m=4;   % podział brzegów elementu trójkątnego
    
    for el=1:size(X,2)
      x=X(:,el);
      y=Y(:,el);
      d=D(:,el);
 
 
 xe=[];
 ye=[];
 de=[];
 
   for i=1:m+1
        for j=i:-1:1
            N=[1-(i-1)/m (j-1)/m (i-j)/m];
            de=[de; N*d];
            xe=[xe ; N*x];
            ye=[ye ; N*y];
        end
   end
      top=[];
    for i=m:-1:1
        for j=0:i-1
        top=[top; (i+1)*(i+2)/2-j i*(i+1)/2-j (i+1)*(i+2)/2-1-j];
        end
        for j=0:i-2
            top=[top; i*(i+1)/2-j i*(i+1)/2-j-1 (i+1)*(i+2)/2-1-j];
        end
    end
    
   Ex=[];
   Ey=[];
   Ed=[];
   top=[top top(:,1)];
   for i=1:size(top,1)
     Ex=[Ex xe(top(i,:)) ];
     Ey=[Ey ye(top(i,:)) ];
     Ed=[Ed de(top(i,:)) ];
   end
   
   fill(Ex,Ey,Ed)
   colormap jet
  shading interp
  colorbar
    hold on 
   plot([x ;x(1)],[y;y(1)],'k')
  
   %plot(xe,ye,'go')
  end 