MATLAB: Is there any function like ‘uigetfile’ or ‘uiopen’ so that I can chose an Image of the own choice each time I want to process an Image with out using ‘imread()’

image processingimreaduigetfileuiopen

Hello,
I am doing some image processing. If I use 'imread('img.jpg') I have to specify the name in advance. I have images under different names so it requires me to change the name in imread() every time I run the code. I want to ask if there is any other function such as 'uiopen' or 'uigetfile' so that I can select the image of my choice when I run the script file.
Thanks.

Best Answer

[filename, directory] = uigetfile('Select an image');
complete_name = fullfile(directory, filename);
TheImage = imread(complete_name);