MATLAB: Changing pictures exitpausestart hi how can I create a gui that will show different pictures on the same axes but displaying only one at a time automatically Best Answer Define "automatically." Do you mean in a for loop? See the FAQ: http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F so you'll know how to do stuff like this:filePattern = fullfile(myFolder, '*.jpg');jpegFiles = dir(filePattern);for k = 1:length(jpegFiles) baseFileName = jpegFiles(k).name; fullFileName = fullfile(myFolder, baseFileName); fprintf(1, 'Now reading %s\n', fullFileName); imageArray = imread(fullFileName); imshow(imageArray); % Display image. drawnow; % Force display to update immediately. promptMessage = sprintf('Do you want to Continue or Cancel?'); button = questdlg(promptMessage, 'Continue', 'Continue', 'Cancel', 'Continue'); if strcmpi(button, 'Cancel') break; endend Related SolutionsMATLAB: How should i compress the some multiple images by 1st converting to them gray scale and all images are supposed to be of same size. This could be because you are using imshow.Convert your image to grayscale using:I = rgb2gray(img);% Resize your imageI=imresize(I,[a,b]); specify the dimensions you want% Finally write your image% imwrite(I,'name.jpg'); MATLAB: How to read all the images in a folder?? You can use dir to get a structure with of the files listed, and you can use a wildcard search too:myFolder = 'C:\Documents and Settings\yourUserName\My Documents\My Pictures';if ~isdir(myFolder) errorMessage = sprintf('Error: The following folder does not exist:\n%s', myFolder); uiwait(warndlg(errorMessage)); return;endfilePattern = fullfile(myFolder, '*.jpg');jpegFiles = dir(filePattern);for k = 1:length(jpegFiles) baseFileName = jpegFiles(k).name; fullFileName = fullfile(myFolder, baseFileName); fprintf(1, 'Now reading %s\n', fullFileName); imageArray = imread(fullFileName); imshow(imageArray); % Display image. drawnow; % Force display to update immediately.endThis example if taken straight from the Wiki FAQ:http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F Related QuestionI have a sequence of images and I want to apply something (Gabor filter) on each of the imagesHow to select a folder at runtime
Best Answer