• Remix
  • Share
  • New Entry

on 7 Oct 2021
  • 1
  • 12
  • 1
  • 0
  • 248
x=1;y=1;s=0;p=-1;X=zeros(1e6,2);
for i=1:1e6
x=x/2;y=y/2;
if s==1
x=x+1/2;
elseif s==2
x=x+1/2;y=y+1/2;
elseif s==3
y=y+1/2;
end
p=s;
while s==p
s=randi(4);
end
X(i,:)=[x,y];
end
hold on;
for j=1:1e3:1e6
plot(X(j:j+999,1),X(j:j+999,2),'.','markersize',0.001);
end
axis equal off;
Image
Remix Tree