• Remix
  • Share
  • New Entry

on 29 Nov 2023
  • 9
  • 16
  • 1
  • 0
  • 305
drawframe(1);
Write your drawframe function below
function drawframe(f)
persistent h i n A I mapsize
if f == 1
n = 48;
C = rand(n);
h = imshow(C);
map = [0.95 0.95 0.95; repmat([0 0 0.75; 0 0 0.8],10,1)];
mapsize = size(map);
colormap(map)
i = 1:n^2;
A = h.CData;
I = A(end,:) > 1/mapsize(1);
end
A(mod(i+1,n^2)+1) = A(mod(i,n^2)+1);
I = I.*A(end,:) > 1/mapsize(1);
h.CData = A.*[ones(n-1,n);I];
i = i+1;
end
Animation
Remix Tree