- /
-
a walk in 13D
on 1 Dec 2023
- 9
- 69
- 0
- 2
- 338
drawframe(1);
Write your drawframe function below
function drawframe(f)
global hg h xr t N
if f==1
rng("default");
N = 500;
h = 1e-1;
[X,Y] = meshgrid(linspace(0,1,N));
d = 13;
t = rand(1,d);
offset = 0;
tmp = randn(d,d);
[V,~] = eig(tmp+tmp');
xr = [X(:) Y(:) zeros(N*N,d-2)]*V;
C = prod((-1).^floor(xr ./h),2);
hg = imshow(reshape(C,N,N));
else
dh = 1e-4
xr = xr+f*dh*t;
C = prod((-1).^floor(xr ./h),2);
hg.CData = reshape(C,N,N);
drawnow;
end
end