- /
-
View from a train window
on 1 Dec 2023
- 15
- 24
- 0
- 1
- 362
drawframe(1);
Write your drawframe function below
function drawframe(f)
persistent Y
if(f==1)
r = rand(1,4000);
for i=1:5
Y(i,1:800) = smoothdata(smoothdata(r(800*(i-1)+1:i*800)));
end
end
clf
hold on
phi = linspace(0,1,4);
patch([1 30 30 1],[0 0 1.5 1.5],phi);
colormap(sky);
c = bone(8);
m = fliplr(1:5);
for i=5:-1:1
area(Y(i,1+(m(i)-1)*f:30+(m(i)-1)*f)+(i/10),'FaceColor',c(i,:),'EdgeAlpha',0)
end
hold off
axis([1 30 0 1.5])
set(gca,'XTick',[],'YTick',[])
end