- /
- 
        Error 404
        on 30 Nov 2023
        
        
 
    - 3
- 18
- 1
- 0
- 745
drawframe(1);
 Write your drawframe function below
function drawframe(f)
    persistent A X cmap;
    if f==1
        text(0.5,0.5,sprintf('Error 404\nNot Found'),'Fontsize',30,'FontWeight','bold','HorizontalAlignment','center','VerticalAlignment','middle','color','g');
        axis([0 1 0 1]);
        axis equal off;
        set(gcf,'color','k');
        a = getframe(gcf);
        %set(gcf,'color','w');
        a = imresize(a.cdata,0.5,"bicubic","Antialiasing",true);
        [X,cmap] = rgb2ind(a,256,"dither");
        A = X;
    end
    Npixels = round(2.^randi([0,3],1,1).*5.^randi([0,2],1,1));
    x = zeros(size(A,1),1);
    x(1:Npixels) = randi([0,10],1,1);
    MaxMove = randi([1,Npixels],1,1);
    for i=1:size(A,1)/Npixels
        x(i*Npixels + (1:Npixels)) = x((i-1)*Npixels + (1:Npixels))+randi([-1,1]*MaxMove,1,1);
    end
    for i=1:size(A,1)
    A(i,:,1) = circshift(X(i,:),x(i),2);
    end
    imagesc(A); colormap(cmap); set(gca,'units','normalized','position',[0 0 1 1]); axis equal off;
end
Animation
 
           

 

 
             
            