MATLAB: How to access uigetfile elements via a loop

guiimadjust()image processingMATLABuigetfileuser interface

I have to perform the following steps on set of images via matlab GUI:
1. Read multiple images from directory
2. Process them (Apply imadjust on each image)
3. Store them in user specified or same directory while renaming them.
Can someone kindly provide me the code for the same.
I am stuck after this :
[filename, pathname,~] = uigetfile( ...
{'*.jpg;*.jpeg;',...
'JPEG Files (*.jpg,*.jpeg)';
'*.png', 'PNG files (*.png)'; ...
'*.bmp','BMP File (*.bmp)'; ...
'*.tiff;*.tif','TIFF Files (*.tiff,*.tif)'; ...
'*.*', 'All Files (*.*)'}, ...
'Pick a file',...
'Multiselect','on');
set(handles.inputpathtext,'String',pathname);

Best Answer

When you have Multiselect on, the pathname that is returned is a cell array of strings. To process each of the files you need to loop over that array.
for K = 1 : length(filename)
thisfile = fullfile(pathname, filename{K});
now process thisfile
end