MATLAB: How get some images from subplot

digital image processingimage processingImage Processing ToolboxMATLAB

I have some images display in subplot and then I want select one or some images name of them for my propose in retrieval image
if true
% for i = 1:totalImages
imgname = sortedImgs(i);
imgname = int2str(imgname);
strname = strcat('images\', imgname, '.jpg');
returnedImage = imread(strname);
subplot(5, 4, i+1);
imshow(returnedImage, []);
end
end
Help me with code plz!

Best Answer

Try setting a flag in the button down event of each axes that indicates which axes they clicked on.