function S=sier(A) %Sierpinski triangle. -JJL [M,N]=size(A); if M~=2,error('Incorrect data format'),end; b1=repmat([.5,0]',1,N); b2=repmat([0,.5]',1,N); y1=.5*A; y2=y1+b1; y3=y1+b2; x=[y1(1,:),y2(1,:),y3(1,:)];y=[y1(2,:),y2(2,:),y3(2,:)]; plot(x,y,'.') if nargout>0,S=[x;y];end