Prev: Simelectronics: torque and velocity measurement (DC motor)
Next: An exact simplification challenge - 101 (tan, arctan)
From: Faisal on 4 Aug 2010 06:52 Hi all, I've been trying to make an animation in avi format using the following code (posted at the end). The main issues i'm having are: 1. the animation is messed up displaying different parts of the animation in different areas eg. what should be at the bottom left corner is displayed in the top right corner. 2. the file is 4gb Any help, especially with the first issue would be greatly appreciated! ------------------------------- load 11_51.MAT; %Define area to be recorded hf=figure; rect=get(hf,'Position'); rect(1:2)=[0 0]; %DEFINE number of frames nframe1=14000; %initialise matrix using 'moviein' frame1=moviein(nframe1, hf, rect); %Fix the features of the plot window set(hf,'NextPlot','replacechildren') %generate frames for j=1:14000 %xlid, zlid or xlidT, zlidT plot(xlid(j,:),zlid(j,:)); %setting axis axis([-2 12 0 2]); title(['Swash Motion, frame: ',num2str(j)]); xlabel('wave position (m)'); ylabel('wave height (m)') frame1(j,:)= getframe(hf, rect); end save frame1 %save movie as avi movie2avi(frame1,'swash motion1.avi'); |