• Remix
  • Share
  • New Entry

on 7 Nov 2023
  • 7
  • 129
  • 0
  • 6
  • 379
drawframe(1)
Write your drawframe function below
function drawframe(f)
% Green purple-eater
% Inspired by Michael Bach's Purple chaser, this animation becomes a bit
% too small to get the full experience - but close in on your screen and
% look at the cross...
cmp = flipud(gray(128));
cmp(:,[1,3]) = 1;
[x,y] = meshgrid(-1:0.01:1);
colormap(cmp)
brighten(0.5)
theta = (0:30:330)*pi/180;
r = 4.5;
for i1 = numel(theta):-1:1
if i1 ~= ceil(f/4)
phP(i1) = pcolor(r*cos(theta(i1))+x,y+r*sin(theta(i1)),exp(-4*x.^2-4*y.^2));
shading flat
hold on
end
end
axis([-5.55 5.55 -5.55 5.55])
plot([-1 1],[0 0],'k')
plot([0 0],[-1 1],'k')
set(gca,'xtick',[],'ytick',[])
hold off
end
Animation
Remix Tree