display multiple images as separate pop ups in matlab

One way to display multiple images as separate pop ups in Matlab is by using a Graphical User Interface (GUI). Here's some sample code that demonstrates this approach:

main.m
% Create a cell array of image filenames to display
imageFilenames = {'image1.jpg', 'image2.jpg', 'image3.jpg'};

% Create a new GUI window
figureHandle = figure('Name', 'Image Viewer', 'MenuBar', 'none', 'ToolBar', 'none');

% Loop through each image filename and display it in a separate pop up
for i = 1:numel(imageFilenames)
    
    % Read the image file and display it in a new figure window with a title
    imageData = imread(imageFilenames{i});
    figure('Name', imageFilenames{i})
    imshow(imageData);
    
end
524 chars
16 lines

In this code, we first create a cell array called imageFilenames that contains the filenames of the images we want to display. We then create a new GUI window using the figure() function.

Next, we loop through each image filename in imageFilenames and display it in a separate pop-up window using the imread() and imshow() functions within a new figure window. The i loop variable is used to create dynamic figure names for each pop-up window.

Note that this code assumes that all the images are stored in the same directory as the Matlab script. If your images are stored in a different location, you will need to modify the imageFilenames variable to include the full file path for each image file.

gistlibby LogSnag