- /
-
Sticky note
on 24 Nov 2023
- 11
- 14
- 4
- 0
- 359
drawframe(1);
Write your drawframe function below
function drawframe(f)
ax=axes('position',[0 0 1 1]);
Dx=0.1:0.1:0.6;
for i=1:length(Dx)
dx=Dx(i);
if mod(i,2)==1
c='k';
else
c='y';
end
if f<=16
g=f;
elseif f<=28
g=f-(f-16)*2;
else
g=f-28;
end
if mod(f,2)==1
x=[-1+dx 1 1-dx -1]*0.6^((g-1)/2);
y=[-1 -1+dx 1 1-dx]*0.6^((g-1)/2);
else
x=[0+dx 1 0-dx -1]*0.6^((g-2)/2);
y=[-1 0+dx 1 0-dx]*0.6^((g-2)/2);
end
patch(x,y,c)
hold on
end
xlim([-1 1])
ylim([-1 1])
axis equal off
end