• Remix
  • Share
  • New Entry

  • michio

  • /
  • A Night Out with MATLAB

on 22 Nov 2023
  • 24
  • 28
  • 0
  • 2
  • 326
drawframe(1);
Write your drawframe function below
function drawframe(f)
% This is a remix (or animated version) of the following entry by Anton Kogios at MATLAB Mini
% Hack 2022
% https://jp.mathworks.com/matlabcentral/communitycontests/contests/5/entries/10700
%
figure
l = f-1;
X=-164:.646:164;
r=sqrt(X.^2+(X'-140-l/2).^2);
b=flip(pink.*winter);
j=[1 1 .9];
colormap([j;b(1:2:end,:)]);
f = zeros(508,508);
for k=1:508
f(k,:)=circshift(r(460,:),randi([-7,7]),2)+k/9-15-l/2.5;
end
image([r;f])
axis([95 410 350 650],'off')
hold on
a=-90:90;
x=-25*cosd(a);
y=24*sind(a);
fill([x x*.4]+268,[y -y]+460+l,j,'EdgeColor',j)
end
Animation
Remix Tree