The background,

Today the Lantern Festival, I also pick up ￶ on the ￱ peace lights, may my country ︇, my city, my home ︊ people, my loved ones, love my people, I love the special time, special special wish wish wish (), all the best things, even the safe haven over the epidemic.

I made a simple GIF to share with you.

Ii. Source code

clc

clear

close all

filename='D:\Matlab\Matlab Map \ Epidemic map \ Epidemic Prevention \yiqi.gif'; % Output path + file name to save. GIF path ='D:\Matlab\Matlab Map \ Epidemic Map \ Epidemic Prevention \';

Files= dir(strcat(path,'*.png')); % this is the directory of the file name to change, mine is a PNG file m=1080;

n=500;

for i=1:length(Files) str =Files(i).name; Img = imread(STR); % Read image; img=imresize(img,[m n]) ; figure(i) imshow(img)set(gcf,'color'.'w'); % set the background to whiteset(gca,'units'.'pixels'.'Visible'.'off'); frame = getframe(gcf); im = frame2im(frame); % converts the movie animation to an addressed image, because the image must be index index image imshow(IM); [I,map] = rgb2ind(im,20); % Converts a true color image to an index imageif i==1;

        imwrite(I,map,filename,'gif'.'Loopcount',inf,'DelayTime'.0.3); %Loopcount is only available at I ==1"Is usefulelse

        imwrite(I,map,filename,'gif'.'WriteMode'.'append'.'DelayTime'.0.3); %DelayTime: Indicates the interval between framesend

    pause(0.5)

end

close all
Copy the code

Third, note

Version: 2014 a