Talk:FAQ/@comment-26009056-20150115114110

I have a folder(13 Jan) containing 100 image files(tif). I have to display 8 image files in two seprate window, each containg 4 images files out of these 100. These 8 images should be selected like 1st,16th,32nd,48th,64th,80th... (some specific oder sequence) like this, dynamically.

I had already tried a code but it is selecting randomly images instead of specific order that i would like to display in two seprate window. You can email me solution or modification to:anandcs310@gmail.com

Here is the code :

myFolder = '/home/anand/Desktop/13 Jan'; if ~isdir(myFolder) errorMessage = sprintf('Error: The following folder does not exist:\n%s', myFolder); uiwait(warndlg(errorMessage)); return; end filePattern = fullfile(myFolder, '*.tif'); jpegFiles = dir(filePattern); m=length(jpegFiles); fprintf('no of images=%d\n ',m); n=m/4; y=1; for k = 1:n baseFileName = jpegFiles(k).name; fullFileName = fullfile(myFolder, baseFileName); fprintf(1, 'Now reading %s\n', fullFileName); imageArray = imread(fullFileName); subplot(2,2,y),imshow(imageArray); title(baseFileName); y=y+1; imshow(imageArray);  % Display image. drawnow; % Force display to update immediately. end