% frame=1; % width=50; % height=100; % pad=0; % zmax=0; % zmin=0; % hf=figure('position',[100 100 640 480],'Visible','off'); % % try % % aviobj = close(aviobj); % % catch % % end % % aviobj = avifile('mymovie2.avi','fps',5); % url='MVXY12EZ.CSV'; % % get first frame % Z = csvread(url,pad,0,[pad, 0,(pad+height-1), (width-1)]); % Z = flipud(Z)'; % mesh(Z); % set(get(gca,'XLabel'),'String','X'); % set(get(gca,'YLabel'),'String','Y'); % set(get(gca,'ZLabel'),'String','Amplitude'); % set(get(gca,'Title'),'String','Frame: 1 of 102'); % axis tight % zlim([-3e+005 3e+005]); % F(1) = getframe(gcf); % set(gca,'nextplot','replacechildren'); % % Record the movie % for frame = 2:102 % pad=(frame-1)*height; % Z = csvread(url,pad,0,[pad, 0,(pad+height-1), (width-1)]); % Z = flipud(Z)'; % mesh(Z) % % axis 'auto z' % set(get(gca,'Title'),'String',['Frame: ',num2str(frame),' of 102']); % F(frame) = getframe(gcf); % if frame>34 % % zlim([-1.3e+005 1.3e+005]); % % else % % axis 'auto z' % end % czmax=max(Z(:)); % if czmax>zmax % zmax=czmax; % end % czmin=min(Z(:)); % if czmin