contourf with looping to make gif

조회 수: 17 (최근 30일)
gugum gumbira
gugum gumbira 2016년 4월 27일
댓글: gugum gumbira 2016년 4월 27일
Dear all, I have few problems here, firstly I have matrix data C = 628x3540, then I would make contour with contourf for every (:,1:708), (:,709:1416),(:,1417:2124), (:,2125:2832),(:,2833:3540). after that I will save that result from contourf to make gif files/animation. How to do that ?
Thanks a lot

채택된 답변

KSSV
KSSV 2016년 4월 27일
figure(1)
filename = 'testnew51.gif';
C = randn(628,3540);
iwant1 = [1,709,1417,2125,2833] ;
iwant2 = [708,1416,2124,2832,3540] ;
for n = 1:length(iwant1)
contourf(C(:,iwant1(n):iwant2(n))) ;
drawnow
frame = getframe(1);
im = frame2im(frame);
[imind,cm] = rgb2ind(im,256);
if n == 1;
imwrite(imind,cm,filename,'gif', 'Loopcount',inf);
else
imwrite(imind,cm,filename,'gif','WriteMode','append');
end
end
  댓글 수: 1
gugum gumbira
gugum gumbira 2016년 4월 27일
Thanks a lot Dr. Siva. Also I really interest with your profile. could I have your email please ? for further correspondence Thanks again

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Contour Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by