• Remix
  • Share
  • New Entry

on 18 Nov 2023
  • 14
  • 20
  • 0
  • 1
  • 287
drawframe(48);
Write your drawframe function below
function drawframe(f)
Bound = 1;
c = -0.8+1i*0.156;
N = 100;
temp = linspace(-Bound, Bound, 500);
%replicate temp 500 times
R = repmat(temp,500,1);
%transpose R
I = transpose(R);
%add real and imaginary parts
Z = R + (1i*I);
%generate 500x500 array of all values N
M = repmat(N,500,500);
for n = (1 : f)
Z = Z.^2 + c;
M((abs(Z) > 2)) = n;
Z((abs(Z) > 2)) = NaN;
imagesc(temp,temp,atan(0.1*M)); axis xy; drawnow;
title(sprintf('Frame %d',n))
end
end
Animation
Remix Tree