-
大小: 2.66MB文件類型: .zip金幣: 2下載: 0 次發(fā)布日期: 2023-10-03
- 語言: Matlab
- 標(biāo)簽: matlab??動態(tài)gif??直接運行??
資源簡介
實例使用:
第一步:圖像數(shù)據(jù)_請導(dǎo)入到matlab.mat
第二步:運行matlab_out_gif.m內(nèi)程序
可以使用matlab內(nèi)矩陣數(shù)據(jù)成像后做gif,也可以直接導(dǎo)入已有圖片生成gif

代碼片段和文件信息
colormap(gray); %輸出灰度圖
for?i=1:11
%?已經(jīng)存在的圖片
%?Img=imread([‘C:\Users\wm\Desktop\131216\P‘?num2str(3+2*i)?‘.png‘]);
%?imshow(Img);
%?數(shù)據(jù)矩陣現(xiàn)生成圖像
Data1=reshape(vot_off_data(2:132301i)420315);
eval([‘P_off‘num2str(i)‘=transpose(Data1);‘]);
eval([‘imagesc(P_off‘num2str(i)‘(1:2201:419));‘]);
eval([‘title(‘‘第‘num2str(i)‘張圖片‘‘);‘]);
frame=getframe(gcf);
im=frame2im(frame); %制作gif文件,圖像必須是index索引圖像
[Imap]=rgb2ind(im256);
if?i==1
imwrite(Imap‘face.gif‘?‘Loopcount‘inf‘DelayTime‘0.5);%第一次必須創(chuàng)建!
else
imwrite(Imap‘face.gif‘‘WriteMode‘‘a(chǎn)ppend‘‘DelayTime‘0.5);
end
end
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????720??2013-12-18?17:09??matlab_out_gif.m
?????文件?????2057320??2013-12-18?17:10??圖像數(shù)據(jù)_請導(dǎo)入到matlab.mat
?????文件??????780411??2013-12-18?17:03??face.gif
評論
共有 條評論