MATLAB: How to make next page in GUI

callbackguiguide

Hello
I am making image browser and I have problem with button Next Page everytime when I press button next page I want to show next 12 images and I am using this code:
for j = (jj+1) : (2*jj)
[I cmap] = imread(img(j),'frames','all');
ax=subplot(4,3,(j-12));
image(I);
colormap(ax,cmap);
axis off;
axis image;
end
where jj=12 first is showen 12 images and pressing Next Page button there should be displayed next 12. This code works when I press button Next Page first time after I run GUI but it doesn't work when I hit it second or third time…What should I do to display 12 new images every time I hit button Next Page
Thank you!

Best Answer

What is img(j)? How is that a color or black and white image? It should be a filename string.