MATLAB: How to select a folder at runtime

image acquisitionimage analysis

I have five folder. Each folder contains nearly 30 images. My programme is capable to read and execute all the images simultaneously from a specific folder by executing following code
srcFiles = dir('F:\Input_image\*.jpg');
for i = 1 : length(srcFiles)
filename = strcat('F:\Input_image\',srcFiles(i).name);
I{i} = imread(filename);
end
Each time when I execute all the folder I have to change the path, manually. Is it possible to change the path by executing the programme.

Best Answer

Try uigetdir().