X label for matlab movie

Hello,
I am struggleing with setting the XLabel of a movie. My code is as follows:
function [ movieout ] = WebMovieSimple(imagein)
[xweb dweb] = size(imagein);
% number of lines (frames) to display at one time
dwebdisp = 50;
% Prepare the new file.
vidObj = VideoWriter('movie.avi');
open(vidObj);
% set the display properties for the figure
imagesc(imagein(:,1:dwebdisp),[-5 5]);
colorbar
l1=1;
l2=10+1;
l3=20+1;
l4=30+1;
l5=40+1;
l6=50+1;
set(gca,'XTickLabel',[l1;l2;l3;l4;l5;l6]);
set(gca,'nextplot','replacechildren');
% Record movie
for i = 1:(dweb-dwebdisp);
imagesc(imagein(:,i:(i+dwebdisp)),[-5 5]);
colorbar
set(gca,'XTickLabel',[l1+i;l2+i;l3+i;l4+i;l5+i;l6+i]);
movieout(i) = getframe(gcf);
writeVideo(vidObj,movieout(i));
end
% Close the file.
close(vidObj);
end
Then, I call the function as follows: WebMovieSimple(randn(64,100));
The result is what I need but the xlabel are just not correct. If my input image is 100 columns, I would like the window to cover 50 columns (dwebdisp = 50;) and change over time until the entire file has been displayed and recorded.
would anyone know how to fix my xlabel issus?
thank you,
Bob

Answers (0)

Asked:

Bob
on 11 Sep 2013

Community Treasure Hunt

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

Start Hunting!