


MOVIE_PLAYER Quick and dirty way to watch an xyt matrix as a movie. MOVIE_PLAYER(MOV) plays the pages of a 3-D matrix as a movie. An optional second argument is the interframe pause interval (sec).


0001 function movie_player(mov, pauz) 0002 %MOVIE_PLAYER Quick and dirty way to watch an xyt matrix as a movie. 0003 % MOVIE_PLAYER(MOV) plays the pages of a 3-D matrix as a movie. An 0004 % optional second argument is the interframe pause interval (sec). 0005 0006 if (nargin < 2) 0007 pauz = 0; 0008 end 0009 0010 % use the 'pcolor' command if you want interpolated coloring, but if you 0011 % don't 'image' is better because 'pcolor' won't show the last row/col. 0012 % hand = pcolor(mov(:,:,1)); 0013 % shading interp 0014 % %set(gcf,'Renderer','OpenGL'); % faster (but no colormap interpolation) 0015 % set(hand,'CDataMapping','scaled'); % map to clim, . . . 0016 0017 hand = imagesc(mov(:,:,1)); 0018 %set(gcf, 'Renderer', 'Painters', 'DoubleBuffer','on'); 0019 0020 axis xy 0021 set(gca,'CLim',[min(mov(:)) max(mov(:))]); % . . . set to the range of the data 0022 %set(gca, 'CLim', [-3000, 3000]) 0023 h = title('');HGH 0024 for k = 1:size(mov,3) 0025 set(hand,'CData',mov(:,:,k)); 0026 set(h, 'String', ['Image #' num2str(k)]); 0027 pause(pauz); 0028 drawnow 0029 end 0030