• Remix
  • Share
  • New Entry

on 12 Nov 2023
  • 6
  • 34
  • 1
  • 0
  • 365
drawframe(1);
Write your drawframe function below
function drawframe(f)
% Background plot
figure
axis([0 1 0 1]);
axis equal;
axis off
% Falling string
s = '******';
% define the frames
frames = 48;
t = 1:frames; % define frame vector
% compute x
x = -0.2:0.5/frames:0.3;
x = t/frames * .5 - 0.2;
% compute y
y = 1 - 0.5 * ((t * 10)/frames).^8;
y = .5 + y / 10^8;
% compute rotation
a = (y - .5) * 180;
% draw the letters
for i=1:length(s)
index = i * 4 + f;
if index <= 48
text( x(index) + .08 * i, y(index), s(i), ...
'Rotation', a(index), ...
'FontSize', 24 * i , ...
'Color', [47, 126, 178]/255);
end
end
end
Animation
Remix Tree