• Remix
  • Share
  • New Entry

on 8 Nov 2023
  • 4
  • 3
  • 0
  • 0
  • 474
drawframe(1);
Write your drawframe function below
function drawframe(f)
axes('Position',[0,0,1,1])
d = abs(23.5-f)/48;
rng(1934)
t = linspace(-2,2,999);
[x,y] = meshgrid(t,t);
f1 = @(k1,k2,x,y) k1*sin(randn*4*y).*x.^2 + k2*cos(randn*4*x).*y.^2;
f2 = @(k1,k2,x,y) sin(k1*x).*sin(k2*y);
p1 = randn*f1(d,randn,x,y) + d*f2(d*10,randn*10,x,y);
p2 = randn*f1(d,randn,x,y) + randn*f2(d*10,d*10,x,y);
ff = f2(d*3,d*3,p1+2*randn,p2+2*d);
s = ff+flipud(ff)+fliplr(ff);
[index1,index2] = find(s > 0.8*max(s(:)));
imagesc(s)
hold on
plot(index1, index2,'r.')
axis off
colormap('gray')
end
Animation
Remix Tree