• Remix
  • Share
  • New Entry

on 11 Nov 2023
  • 8
  • 24
  • 0
  • 0
  • 727
drawframe(1);
Write your drawframe function below
function drawframe(f)
cla
set(gca,'clipping','off')
s=f/250;
t=s*(1+100*s);
a=0.3+t;
b=0.7+t;
patch('Faces',1:4,'Vertices',[0+t 0; 1+t 0; 0.9+t 0.3; 0.1+t 0.3],'FaceColor','k');
patch('Faces',1:4,'Vertices',[0.25+t 0.3; 0.75+t 0.3; 0.7+t 0.5; 0.3+t 0.5],'FaceColor','k');
patch('Faces',1:4,'Vertices',[0.35+t 0.35; 0.48+t 0.35; 0.48+t 0.45; 0.37+t 0.45],'FaceColor','y');
patch('Faces',1:4,'Vertices',[0.52+t 0.35; 0.65+t 0.35; 0.63+t 0.45; 0.52+t 0.45],'FaceColor','y');
hold on
plot([a b], 0,'wo','markersize',23,'linewidth',5)
plot([a b], 0,'ko','markersize',20,'linewidth',2,'MarkerFaceColor','k')
plot([a b], 0,'wo','markersize',10,'linewidth',2,'MarkerFaceColor','b')
plot([-1 4],[-0.2 -0.2],'-','color',[0.7 0.7 0.7],'linewidth',20)
axis([0 3 -1 1])
axis off
hold off
end
Animation
Remix Tree